File tree 9 files changed +21
-8
lines changed
9 files changed +21
-8
lines changed Original file line number Diff line number Diff line change
1
+ environment = " development"
Original file line number Diff line number Diff line change
1
+ environment = " production"
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ You will need to install the following modules for optimization reasons
29
29
# install node JS here: https://nodejs.org/en/download/
30
30
# install yarn here: https://classic.yarnpkg.com/en/docs/install
31
31
# install ngrok here: https://ngrok.com/download
32
- > yarn global add npx cross- env
32
+ > yarn global add env-cmd
33
33
> cd path_to_your_project
34
34
> yarn install
35
35
> yarn start
Original file line number Diff line number Diff line change 4
4
"author" : " Kana00" ,
5
5
"license" : " SEE LICENSE IN ./LICENSE" ,
6
6
"scripts" : {
7
- "start" : " npx webpack-dev-server --open --hot" ,
8
- "build" : " cross-env NODE_ENV=production webpack --config ./webpack.config.js" ,
7
+ "start:development " : " env-cmd -f .env.development webpack-dev-server --open --hot" ,
8
+ "build" : " webpack --config ./webpack.config.js" ,
9
9
"shareProduction" : " ngrok http -bind-tls=true file:///Users/YOUR_USER/Documents/web-site-new-project/dist" ,
10
10
"shareWebpack" : " ngrok http localhost:8080 -bind-tls=true -host-header='localhost:8080'" ,
11
11
"test" : " npx jest"
41
41
},
42
42
"dependencies" : {
43
43
"@reach/router" : " ^1.3.3" ,
44
+ "@types/node" : " ^14.14.22" ,
44
45
"@types/reach__router" : " ^1.3.1" ,
45
46
"@unly/universal-language-detector" : " ^2.0.3" ,
46
47
"apollo-cache-inmemory" : " ^1.6.5" ,
Original file line number Diff line number Diff line change @@ -26,10 +26,8 @@ const apolloClient: ApolloClient<NormalizedCacheObject> = new ApolloClient({
26
26
link
27
27
} ) ;
28
28
29
-
30
29
class App extends React . Component < any , { } > {
31
30
32
-
33
31
componentDidMount ( ) {
34
32
document . title = 'React Application' ;
35
33
}
Original file line number Diff line number Diff line change @@ -22,18 +22,22 @@ declare module "*.woff" {
22
22
const url : string ;
23
23
export default url ;
24
24
}
25
+
25
26
declare module "*.woff2" {
26
27
const url : string ;
27
28
export default url ;
28
29
}
30
+
29
31
declare module "*.eot" {
30
32
const url : string ;
31
33
export default url ;
32
34
}
35
+
33
36
declare module "*.ttf" {
34
37
const url : string ;
35
38
export default url ;
36
39
}
40
+
37
41
declare module "*.otf" {
38
42
const url : string ;
39
43
export default url ;
Original file line number Diff line number Diff line change
1
+ declare namespace NodeJS {
2
+ interface ProcessEnv {
3
+ ENVIRONMENT : 'development' | 'production' ;
4
+ }
5
+ }
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
3
3
const WebpackCleanupPlugin = require ( 'webpack-cleanup-plugin' ) ;
4
4
const FaviconsWebpackPlugin = require ( 'favicons-webpack-plugin' ) ;
5
5
6
- const isInProduction = process . env . NODE_ENV === 'production' ;
7
-
8
6
module . exports = {
9
7
entry : {
10
8
/* All files that need to be grouped together into a <script src='...'> */
@@ -16,7 +14,7 @@ module.exports = {
16
14
filename : '[name]_[hash].bundle.js' ,
17
15
publicPath : "/"
18
16
} ,
19
- mode : ( isInProduction ) ? 'production' : 'development' ,
17
+ mode : ( process . env . environment === 'production' ) ? 'production' : 'development' ,
20
18
devtool : 'inline-source-map' ,
21
19
devServer : {
22
20
contentBase : './dist' ,
Original file line number Diff line number Diff line change 2426
2426
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.31.tgz#d6b4f9645fee17f11319b508fb1001797425da51"
2427
2427
integrity sha512-T+wnJno8uh27G9c+1T+a1/WYCHzLeDqtsGJkoEdSp2X8RTh3oOCZQcUnjAx90CS8cmmADX51O0FI/tu9s0yssg==
2428
2428
2429
+ "@types/node@^14.14.22":
2430
+ version "14.14.22"
2431
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18"
2432
+ integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==
2433
+
2429
2434
"@types/parse5@^5.0.3":
2430
2435
version "5.0.3"
2431
2436
resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109"
You can’t perform that action at this time.
0 commit comments