-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
executable file
·53 lines (52 loc) · 1.32 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
/*
This is the webpack config for the production build.
*/
'use strict'
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = {
devtool: 'cheap-module-source-map',
entry: [
'./src/js/main.js',
],
output: {
filename: '[name].js',
path: path.join(__dirname, './dist'),
publicPath: '/dist/',
},
module: {
loaders: [{
test: /\.jsx?$/,
loaders: ['babel'],
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract(
'style-loader',
'css-loader!postcss-loader!sass-loader'
),
}, {
test: /\.(otf|eot|svg|ttf|woff|woff2)$/,
loader: 'file?name=[name].[ext]&publicPath=/'
}],
},
plugins: [
new ExtractTextPlugin('[name].css'),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production'),
},
}),
],
postcss: [
autoprefixer({
browsers: ['last 2 versions'],
}),
],
resolve: {
extensions: ['', '.js', '.sass'],
root: [path.join(__dirname, './src')],
},
};