-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.base.config.js
55 lines (49 loc) · 1.27 KB
/
webpack.base.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
var path = require("path");
var webpack = require('webpack');
var BundleTracker = require('webpack-bundle-tracker');
var srcPath = path.resolve('./src/assets/');
var cssPath = path.resolve('./src/assets/css/');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
context: __dirname,
root: srcPath,
entry: './src/assets/js/index',
output: {
path: path.resolve('./src/assets/bundles/'),
filename: "[name]-[hash].js",
chunkFilename: "[id].js"
},
plugins: [
// new ExtractTextPlugin("style.css", {
// allChunks: true
// })
new ExtractTextPlugin("[name].css")
], // add all common plugins here
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style", "css")
}, {
test: /\.txt$/,
loader: 'raw-loader',
}, {
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/,
loader: 'url-loader?limit=10000',
}, {
test: /\.(eot|ttf|wav|mp3)$/,
loader: 'file-loader',
}
] // add all common loaders here
},
resolve: {
modulesDirectories: [
'node_modules',
'bower_components',
srcPath,
cssPath
],
extensions: ['', '.js', '.jsx', 'css']
},
debug: true
}