/
webpack.common.js
66 lines (65 loc) · 1.99 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
63
64
65
66
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const { VueLoaderPlugin } = require('vue-loader')
module.exports = {
entry: {
auth: './app/js/appAuth.js',
dashboard: './app/js/appDashboard.js',
authStyles: './app/js/styles/stylesAuth.js',
dashboardStyles: './app/js/styles/stylesDashboard.js'
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'static/js')
},
plugins: [
new CleanWebpackPlugin(['static/js']), // <== This is Dist folder by fact
new VueLoaderPlugin(),
//new ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(en\fr\ru)$/)
],
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js', // 'vue/dist/vue.common.js' for webpack 1
'@app': path.resolve(__dirname, 'app'),
//'@moment': path.resolve(__dirname, 'node_modules/moment/min/moment.min.js')
}
},
module: {
rules: [
{
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: '../fonts/', // where the fonts will go
publicPath: '/static/fonts' // override the default path
}
}]
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.scss$/,
use: [
"style-loader", // creates style nodes from JS strings
"css-loader", // translates CSS into CommonJS
"sass-loader" // compiles Sass to CSS, using Node Sass by default
]
},
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.html$/,
use: 'html-loader'
}
]}
};