@@ -9,23 +9,34 @@ const baseRule = {
9
9
loader : "babel-loader" ,
10
10
options : {
11
11
presets : [ "@babel/preset-env" ] ,
12
- plugins : [ "@babel/plugin-syntax-dynamic-import" , "@babel/plugin-proposal-optional-chaining" ]
12
+ plugins : [
13
+ "@babel/plugin-syntax-dynamic-import" ,
14
+ "@babel/plugin-proposal-optional-chaining"
15
+ ]
13
16
}
14
17
}
15
18
}
16
19
17
20
const predefinedVariables = {
18
- " transpile_VERSION" : transpile . VERSION
21
+ transpile_VERSION : transpile . VERSION
19
22
}
20
23
21
24
if ( settings . DEBUG ) {
22
25
baseRule . exclude = / n o d e _ m o d u l e s /
23
- predefinedVariables . staticUrl = `(url => ${ JSON . stringify ( settings . STATIC_URL ) } + url)`
24
- } else if ( settings . STATICFILES_STORAGE !== "npm_mjs.storage.ManifestStaticFilesStorage" ) {
25
- predefinedVariables . staticUrl = `(url => ${ JSON . stringify ( settings . STATIC_URL ) } + url + "?v=" + ${ transpile . VERSION } )`
26
+ predefinedVariables . staticUrl = `(url => ${ JSON . stringify (
27
+ settings . STATIC_URL
28
+ ) } + url)`
29
+ } else if (
30
+ settings . STATICFILES_STORAGE !==
31
+ "npm_mjs.storage.ManifestStaticFilesStorage"
32
+ ) {
33
+ predefinedVariables . staticUrl = `(url => ${ JSON . stringify (
34
+ settings . STATIC_URL
35
+ ) } + url + "?v=" + ${ transpile . VERSION } )`
26
36
}
27
37
28
- module . exports = { // eslint-disable-line no-undef
38
+ module . exports = {
39
+ // eslint-disable-line no-undef
29
40
mode : settings . DEBUG ? "development" : "production" ,
30
41
module : {
31
42
rules : [ baseRule ]
@@ -35,8 +46,6 @@ module.exports = { // eslint-disable-line no-undef
35
46
chunkFilename : transpile . VERSION + "-[id].js" ,
36
47
publicPath : transpile . BASE_URL
37
48
} ,
38
- plugins : [
39
- new webpack . DefinePlugin ( predefinedVariables )
40
- ] ,
49
+ plugins : [ new webpack . DefinePlugin ( predefinedVariables ) ] ,
41
50
entry : transpile . ENTRIES
42
51
}
0 commit comments