-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
40 lines (39 loc) · 1.1 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
var webpack = require('webpack'), ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
index: './src/index.js'
},
output: {
path: __dirname + '/build',
filename: 'assets/[name].js',
chunkFilename: 'assets/chunk.[id].js',
},
module: {
rules: [
{
use: ['file-loader?name=[name].[ext]'],
test: /\.html$/,
}, {
use: ['file-loader?name=assets/[name].[ext]'],
test: /\.(ttf|otf|eot|svg|woff(2)?)$/,
}, {
use: ExtractTextPlugin.extract({
use: ['css-loader', 'less-loader'],
fallback: 'style-loader',
publicPath: '../',
}),
test: /\.less$/,
},
],
},
plugins: [
new webpack.ProvidePlugin({
'window.jQuery': 'jquery',
jQuery: 'jquery',
}),
new ExtractTextPlugin({
filename: 'assets/styles.css',
allChunks: true,
}),
],
};