-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
58 lines (53 loc) · 1.28 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
/* eslint-disable no-unused-vars */
var path = require('path'),
webpack = require('webpack'),
ExtractTextPlugin = require('extract-text-webpack-plugin')
// Export the webpack configuration
module.exports = {
entry: {
vendor: ['jquery', '../../../node_modules/material-design-lite/material.min.js'],
admin: ['../admin/admin']
},
// Output controls the settings for file generation.
output: {
filename: '[name].js',
path: path.join(__dirname, 'public/js'),
chunkFilename: '[id].js'
},
// Module settings
module: {
loaders: [{
test: /\.css$/,
loaders: [
ExtractTextPlugin.loader({
extract: true,
omit: 1
}),
'style',
'css'
]
}, {
test: /\.scss$/,
loaders: [
ExtractTextPlugin.loader({
extract: true,
omit: 1
}),
'style',
'css',
'sass'
]
}, {
test: /\.vue$/, // a regex for matching all files that end in `.vue`
loader: 'vue' // loader to use for matched files
}, {
test: /\.js$/,
exclude: /node_modules|admin/,
loader: 'babel'
}]
},
plugins: [
new ExtractTextPlugin('[name].min.css'),
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en|ru/)
]
}