-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.babel.js
66 lines (64 loc) · 1.32 KB
/
webpack.config.babel.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
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import pkgInfo from 'pkginfo'
pkgInfo(module)
module.exports = {
mode: 'production',
// devtool: 'inline-source-map',
performance: {
hints: false
},
node: {
fs: 'empty'
},
entry: {
index: './src/scripts/boundary-import/js/index.js'
},
plugins: [
new MiniCssExtractPlugin({
filename: `web_root/scripts/${module.exports.name}/css/[name].bundle.css`
})
],
output: {
filename: `web_root/scripts/${module.exports.name}/js/[name].bundle.js`,
library: 'boundary'
},
externals: {
jquery: 'jQuery'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'stage-0'],
plugins: [
'transform-es2015-modules-amd',
'transform-regenerator',
'transform-runtime'
]
}
},
{
test: /\.html$/,
loader: 'html-loader',
options: {
minimize: true,
collapseWhitespace: true
}
},
{
test: /\.css$/,
loader: [
MiniCssExtractPlugin.loader,
'css-loader'
]
}
]
},
resolve: {
modules: ['src', 'node_modules'],
extensions: ['.js']
}
}