-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
76 lines (72 loc) · 2.39 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
var webpack = require('webpack')
,WebpackStrip = require('webpack-strip')
,ExtractTextPlugin = require("extract-text-webpack-plugin");
var config = {
entry: {
main: './app-content/main/index.js'
},
output: {
path: './public/assets',
filename: "[name].bundle.js",
publicPath: '/assets/',
chunkFilename: '/assets/[id].js'
},
module: {
loaders: [
{
test: /\.js$/,
use: [
{ loader: 'babel-loader', query: { compact: true } },
WebpackStrip.loader('console.log')
]
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
{ loader: 'css-loader', query: { modules: false, sourceMaps: false, minimize: true } }
]
})
}, {
test: /\.scss$/,
loader: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
{ loader: 'css-loader', query: { modules: false, sourceMaps: false, minimize: true } },
{ loader: 'sass-loader', query: { sourceMaps: false } }
]
})
}, {
test: /\.(jpe?g|png|gif|svg|ico)$/i,
loader: "file-loader?name=/img/[name].[ext]",
exclude: /node_modules/
}, {
test: /\.(mp4)$/i,
loader: "file-loader?name=/videos/[name].[ext]",
exclude: /node_modules/
}, {
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader?limit=10000&mimetype=application/font-woff"
}, {
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader"
}, {
test: /\.html$/,
loader: 'raw-loader',
exclude: /node_modules/
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
sourceMap: false,
comments: false
}),
new ExtractTextPlugin("[name].css")
],
cache: false
};
module.exports = config;