-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
62 lines (60 loc) · 1.72 KB
/
Copy pathwebpack.config.js
File metadata and controls
62 lines (60 loc) · 1.72 KB
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
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
entry: {
'admin': './assets/js/admin.js',
'admin.mediamanager': './assets/js/admin.mediamanager.js'
},
output: {
filename: '[name].min.js',
chunkFilename: '[name].min.js',
path: path.resolve(__dirname, 'assets/js/'),
// Resolve async chunks relative to this script's URL
// (e.g. /vendor/nails/module-cdn/assets/js/)
publicPath: 'auto'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.(css|scss|sass)$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
url: false
}
},
'postcss-loader',
{
loader: 'sass-loader',
options: {
api: 'modern'
}
}
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: '../css/[name].min.css',
chunkFilename: '../css/[name].min.css'
}),
new VueLoaderPlugin(),
],
// Keep the MediaManagerV2 async import as a single stable chunk
// (avoid hashed vendor split chunks like 621.min.js)
optimization: {
splitChunks: false
},
externals: {
vue: 'Vue'
},
mode: 'production'
};