-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.base.js
36 lines (31 loc) · 874 Bytes
/
webpack.base.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
var path = require('path');
var webpack = require('webpack');
var entryPath = path.join(__dirname, 'src');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
app: path.join(entryPath, 'app.js')
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
}, {
test: /\.(less|css)?$/,
loader: ExtractTextPlugin.extract(['css', 'less'])
}, {
test: /\.(png|jpg)$/,
loader: 'url?limit=25000'
}, {
test: /\.(svg|ttf|eot|svg|woff(\(?2\)?)?)(\?[a-zA-Z_0-9.=&]*)?(#[a-zA-Z_0-9.=&]*)?$/,
loader: "file-loader"
}]
},
resolve: {
extensions: ['', '.js', '.jsx', '.css', '.less']
},
plugins: [
new webpack.NoErrorsPlugin()
]
}