File tree 4 files changed +23
-28
lines changed
4 files changed +23
-28
lines changed Original file line number Diff line number Diff line change 6
6
"build" : " webpack --mode production"
7
7
},
8
8
"devDependencies" : {
9
+ "@babel/core" : " ^7.1.6" ,
10
+ "@babel/preset-env" : " ^7.1.6" ,
9
11
"babel-core" : " ^6.26.3" ,
10
- "babel-loader" : " ^7.1 .4" ,
12
+ "babel-loader" : " ^8.0 .4" ,
11
13
"babel-preset-env" : " ^1.7.0" ,
12
- "webpack-cli" : " ^2.1.3" ,
13
- "webpack-dev-server" : " ^3.1.4"
14
+ "babel-preset-es2015" : " ^6.24.1" ,
15
+ "webpack" : " ^4.26.0" ,
16
+ "webpack-cli" : " ^3.1.2" ,
17
+ "webpack-dev-server" : " ^3.1.10"
14
18
},
15
19
"dependencies" : {
16
- "dotenv-webpack" : " ^1.5.5" ,
17
- "webpack" : " ^4.8.3"
20
+ "dotenv-webpack" : " ^1.5.5"
18
21
}
19
22
}
Original file line number Diff line number Diff line change 1
1
TEST = TESTING
2
- TEST2 = TESTING
3
- TEST_SECRET = TESTING
2
+ TEST2 = TESTING2
3
+ TEST_SECRET = TESTINGX
Original file line number Diff line number Diff line change 1
- // const { TEST, TEST2 } = process.env
2
- //
3
- // document.querySelector('body').innerHTML = `
4
- // Structured: ${process.env.TEST}<br />
5
- // Destructured: ${TEST}<br />
6
- // <hr />
7
- // Structured: ${process.env.TEST2}<br />
8
- // Destructured: ${TEST2}<br />
9
- // `
10
-
11
- console . log ( 'we are here' )
1
+ const { TEST , TEST2 } = process . env
12
2
console . log ( 'process.env' , process . env )
13
-
14
- document . querySelector ( 'body' ) . innerHTML = `
15
- env: ${ process . env . TEST2 } <br />
16
- define: ${ process . env . SUPERTEST } <br />
17
- all: ${ JSON . stringify ( process . env ) }
18
- `
3
+ console . log ( 'process.env.TEST' , process . env . TEST )
4
+ console . log ( 'TEST' , TEST )
5
+ console . log ( 'TEST2' , TEST2 )
Original file line number Diff line number Diff line change @@ -6,16 +6,21 @@ module.exports = {
6
6
module : {
7
7
rules : [
8
8
{
9
- loader : 'babel-loader' ,
10
- test : path . join ( __dirname , 'src' )
9
+ test : / \. m ? j s $ / ,
10
+ exclude : / ( n o d e _ m o d u l e s | b o w e r _ c o m p o n e n t s ) / ,
11
+ use : {
12
+ loader : 'babel-loader' ,
13
+ options : {
14
+ presets : [ '@babel/preset-env' ]
15
+ }
16
+ }
11
17
}
12
18
]
13
19
} ,
14
20
plugins : [
15
21
// new webpack.NoEmitOnErrorsPlugin(),
16
22
new Dotenv ( {
17
- path : path . resolve ( __dirname , './src/.env.testing' ) ,
18
- systemvars : true
23
+ path : path . resolve ( __dirname , './src/.env.testing' )
19
24
} ) ,
20
25
new webpack . DefinePlugin ( {
21
26
'process.env.SUPERTEST' : JSON . stringify ( 'This is a test' )
You can’t perform that action at this time.
0 commit comments