-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
77 lines (68 loc) · 2.48 KB
/
webpack.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* This file has been autogenerated as it didn't exist or was made for an older incompatible version.
* This file can be used for manual configuration will not be modified if the flowDefaults constant exists.
*/
const merge = require('webpack-merge');
const flowDefaults = require('./webpack.generated.js');
const {BabelMultiTargetPlugin} = require('webpack-babel-multi-target-plugin');
module.exports = merge(flowDefaults, { });
/**
plugins: [ new BabelMultiTargetPlugin({
babel: {
plugins: [
// "@babel/plugin-transform-modules-amd",
["transform-amd-to-commonjs", { "restrictToTopLevelDefine": true }],
// workaround for Safari 10 scope issue (https://bugs.webkit.org/show_bug.cgi?id=159270)
"@babel/plugin-transform-block-scoping",
// Edge does not support spread '...' syntax in object literals (#7321)
"@babel/plugin-proposal-object-rest-spread"
],
presetOptions: {
useBuiltIns: false // polyfills are provided from webcomponents-loader.js
}
},
targets: {
'es6': { // Evergreen browsers
browsers: [
// It guarantees that babel outputs pure es6 in bundle and in stats.json
// In the case of browsers no supporting certain feature it will be
// covered by the webcomponents-loader.js
'last 1 Chrome major versions'
],
},
'es5': { // IE11
browsers: [
'ie 11'
],
tagAssetsWithKey: true, // append a suffix to the file name
}
}
})
]
*/
/**
* This file can be used to configure the flow plugin defaults.
* <code>
* // Add a custom plugin
* flowDefaults.plugins.push(new MyPlugin());
*
* // Update the rules to also transpile `.mjs` files
* if (!flowDefaults.module.rules[0].test) {
* throw "Unexpected structure in generated webpack config";
* }
* flowDefaults.module.rules[0].test = /\.m?js$/
*
* // Include a custom JS in the entry point in addition to generated-flow-imports.js
* if (typeof flowDefaults.entry.index != "string") {
* throw "Unexpected structure in generated webpack config";
* }
* flowDefaults.entry.index = [flowDefaults.entry.index, "myCustomFile.js"];
* </code>
* or add new configuration in the merge block.
* <code>
* module.exports = merge(flowDefaults, {
* mode: 'development',
* devtool: 'inline-source-map'
* });
* </code>
*/