-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
executable file
·79 lines (77 loc) · 1.72 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
77
78
79
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var loaders = [
{
test: /\.js?$/,
loader: 'babel',
query: {
presets: [
'es2015'
],
plugins: []
}
},
{
test: /\.css?$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!autoprefixer-loader?browsers=last 2 versions')
},
{
test: /\.scss?$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!autoprefixer-loader?browsers=last 2 versions!sass-loader')
},
{
test: /\.(png|jpg)$/,
loader: 'url?limit=8192'
},
{
test: require.resolve('animate.css'),
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
},
{
test: require.resolve('wowjs'),
loader: 'imports?this=>window!exports?window.WOW'
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'url?name=static/webfonts/[name].[ext]'
}
];
module.exports = {
devtool: 'cheap-module-source-map',
entry: path.resolve('static/js', 'main.js'),
output: {
path: path.resolve('dist'),
filename: '[name].js',
publicPath: '/dist/'
},
plugins: [
new ExtractTextPlugin('main.css', {
allChunks: true
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
})
],
module: {
loaders: loaders
},
resolve: {
alias: {
'foundation': 'foundation-sites',
'jquery': 'jquery'
}
},
sassLoader: {
includePaths: [path.resolve(__dirname, 'node_modules')]
}
};