teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

package.jsonの内容等を追加

2017/11/21 16:47

投稿

keisuu
keisuu

スコア40

title CHANGED
File without changes
body CHANGED
@@ -11,4 +11,50 @@
11
11
  この挙動から憶測すると、npm startの時はサーバーサイドレンダリングが効いているのか?
12
12
  と思うのですが、いまいちよくわかりません。
13
13
 
14
- npm startの時と、npm run buildの時でサイトに違いがあるのでしょうか?
14
+ npm startの時と、npm run buildの時でサイトに違いがあるのでしょうか?
15
+
16
+
17
+ package.jsonの内容です。
18
+ ```package.json
19
+ {
20
+ "name": "examplelocal",
21
+ "version": "0.1.0",
22
+ "private": true,
23
+ "dependencies": {
24
+ "moment": "^2.19.2",
25
+ "react": "^16.1.1",
26
+ "react-bootstrap": "^0.31.5",
27
+ "react-datetime": "^2.11.0",
28
+ "react-dom": "^16.1.1",
29
+ "react-router-dom": "^4.2.2",
30
+ "react-scripts": "1.0.17"
31
+ },
32
+ "scripts": {
33
+ "start": "react-scripts start",
34
+ "build": "react-scripts build",
35
+ "test": "react-scripts test --env=jsdom",
36
+ "eject": "react-scripts eject"
37
+ }
38
+ }
39
+ ```
40
+
41
+ example.localはローカルのnginxでアクセスしています。
42
+ ```example.local.conf
43
+ server {
44
+ listen 80;
45
+ server_name example.local;
46
+ root /home/examplelocal/examplelocal/build/;
47
+ index index.php index.html index.htm;
48
+ client_max_body_size 99M;
49
+ server_tokens off;
50
+
51
+ location ~ .php$ {
52
+ fastcgi_pass 127.0.0.1:9000;
53
+ fastcgi_index index.php;
54
+ fastcgi_param SCRIPT_FILENAME /home/examplelocal/examplelocal/build$fastcgi_script_name;
55
+ include fastcgi_params;
56
+ }
57
+ }
58
+
59
+
60
+ ```