-
Notifications
You must be signed in to change notification settings - Fork 116
/
Copy pathwebpack.production.config.js
45 lines (44 loc) · 1.1 KB
/
webpack.production.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
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var autoprefixer = require('autoprefixer');
module.exports = {
entry: [
'./src/js/render.js'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'app.min.js'
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
include: path.join(__dirname, 'src'),
loader: 'babel'
},
{
test: /\.scss$/,
loader: 'style!css!postcss!sass'
},
{
test: /\.svg$/,
loader: 'svg-inline'
}
]
},
postcss: function () {
return [autoprefixer({ browsers: ['last 3 versions'] })];
},
resolve: {
extensions: ['', '.js', '.jsx', '.json']
},
plugins: [
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
title: 'react-news',
template: './src/index.html',
scriptFilename: 'app.min.js'
})
]
};