-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsave-remote-file.config.js
43 lines (40 loc) · 1.04 KB
/
save-remote-file.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// save-remote-file.config.js
// returns a webpack config object for the SaveRemoteFile plugin
// webpack plugins
const SaveRemoteFilePlugin = require('save-remote-file-webpack-plugin');
// return a webpack config
module.exports = (type = 'modern', settings) => {
// common config
const common = () => ({
plugins: [
new SaveRemoteFilePlugin(
settings.remoteFiles,
),
],
});
// configs
const configs = {
// development configs
development: {
// legacy development config
legacy: {
},
// modern development config
modern: {
...common(),
},
},
// production configs
production: {
// legacy production config
legacy: {
...common(),
},
// modern production config
modern: {
...common(),
},
}
};
return configs[process.env.NODE_ENV][type];
}