-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
61 lines (58 loc) · 1.26 KB
/
Copy pathwebpack.config.js
File metadata and controls
61 lines (58 loc) · 1.26 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var index = path.join(__dirname, './app/scripts/main.js');
module.exports = {
entry: [
index
],
devtool: 'source-map',
output: {
path: 'dist',
filename: 'bundle.js',
publicPath: '/dist'
},
plugins: [
/*
new webpack.optimize.UglifyJsPlugin({
comments: false,
mangle: true,
compress: {
unsafe: true
}
}),
*/
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'app/index.html',
inject: true
}),
new ExtractTextPlugin('style.css')
],
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel-loader'],
exclude: /node_modules/,
include: __dirname
},
{
test: /\.(frag|vert)/,
loaders: ['raw-loader'],
},
{
test: /\.css?$/,
loaders: ['null'],
include: __dirname
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!less-loader')
}
]
}
};