This repository was archived by the owner on Jun 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathwebpack.config.js
More file actions
45 lines (44 loc) · 1.37 KB
/
webpack.config.js
File metadata and controls
45 lines (44 loc) · 1.37 KB
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
var webpack = require('webpack');
var path = require('path');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
context: path.join(__dirname, 'src'),
entry: {
app: './index.js',
vendors: [
'angular',
'angular-ui-router',
'lodash',
'mobx'
]
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'app.js'
},
resolve: {
extensions: ['', '.js']
},
module: {
loaders: [
{ test: /\.json$/, loader: 'json', exclude: /node_modules/ },
{ test: /\.html$/, loader: 'html', exclude: /node_modules/ },
{ test: /\.css$/, loader: 'style!css', exclude: /node_modules/ },
{ test: /\.less$/, loader: 'style!css!less', exclude: /node_modules/ },
{ test: /\.(png|jpg)(\?]?.*)?$/, loader : 'file', exclude: /node_modules/ },
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url?limit=10000&mimetype=application/font-woff" },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file" },
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'test')
}),
new CopyWebpackPlugin([
{ from: 'index.html' }
]),
new CleanWebpackPlugin(['dist'])
]
};