File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ const resolve = {
1111
1212const clientConfig = {
1313 entry,
14- target : " web" ,
15- devtool : 'nosources- source-map',
16- mode : process . env . NODE_ENV == " production" ? " production" : " development" ,
14+ target : ' web' ,
15+ devtool : process . env . NODE_ENV == 'production' ? 'nosource-source-map' : ' source-map',
16+ mode : process . env . NODE_ENV == ' production' ? ' production' : ' development' ,
1717 output : {
1818 path : outputPath ,
1919 chunkFilename : '[name].bundle.js' ,
@@ -31,14 +31,21 @@ const clientConfig = {
3131 }
3232 ]
3333 } ,
34- resolve
34+ resolve,
35+ plugins : [
36+ // During the build make literal replacements on client side for
37+ // process.env.API_URL, because there is no process.env
38+ new webpack . DefinePlugin ( {
39+ 'process.env.API_URL' : JSON . stringify ( process . env . API_URL || "http://localhost:3000/api" )
40+ } ) ,
41+ ]
3542} ;
3643
3744const serverConfig = {
3845 entry,
3946 target : 'node' ,
40- devtool : 'nosources- source-map',
41- mode : process . env . NODE_ENV == " production" ? " production" : " development" ,
47+ devtool : process . env . NODE_ENV == 'production' ? 'nosource-source-map' : ' source-map',
48+ mode : process . env . NODE_ENV == ' production' ? ' production' : ' development' ,
4249 node : {
4350 __dirname : false
4451 } ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const config = {
1616 node : {
1717 __dirname : false
1818 } ,
19- devtool : 'nosources -source-map',
19+ devtool : serverless . lib . webpack . isLocal ? 'source-map' : 'nosource -source-map',
2020 externals : [ nodeExternals ( ) ] ,
2121 output : {
2222 libraryTarget : 'commonjs2' ,
You can’t perform that action at this time.
0 commit comments