-
Notifications
You must be signed in to change notification settings - Fork 11
/
webpack.common.js
62 lines (60 loc) · 1.63 KB
/
webpack.common.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
'use strict';
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
const { ProvidePlugin, DefinePlugin } = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: {
'admin': './app/assets/admin/main.js',
'web': './app/assets/web/main.js',
'install': './app/assets/install/main.js',
},
output: {
filename: '[name]/bundle.js',
path: path.resolve(__dirname, 'www/dist'),
clean: true
},
plugins: [
new VueLoaderPlugin(),
new ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
}),
new ProvidePlugin({
naja: ['naja', 'default'],
}),
new DefinePlugin({
ALERT_DURATION: 5000,
ALERT_ANIMATION: 1000,
}),
new MiniCssExtractPlugin({
filename: '[name]/bundle.css',
}),
// new (require('webpack-bundle-analyzer').BundleAnalyzerPlugin),
],
module: {
rules: [
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.js$/,
use: 'babel-loader'
},
{
test: /\.(css|scss|sass)$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: '../'
}
},
'css-loader',
'postcss-loader'
],
},
]
}
};