-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.config.js
57 lines (56 loc) · 1.33 KB
/
webpack.prod.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
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
module.exports = {
entry: "./app/app.js",
output: {
filename: "bundle.js",
path: __dirname + "/dist"
},
plugins: [new HtmlWebpackPlugin({
title: 'Reactjs Sandbox',
template: path.join(__dirname, './app/index.html'),
inject: 'body'
}), ],
module: {
loaders: [
{
test: /\.css$/,
loader: 'style!css',
include: [path.resolve(__dirname, 'app')],
exclude: /node_modules/
},
{
test: /\.scss$/,
loaders: ["style", "css", "sass"],
include: [path.resolve(__dirname, 'app')],
exclude: /node_modules/
},
{
test: /\.js$/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-0']
},
include: [path.resolve(__dirname, 'app')],
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|woff|woff2)$/,
loader: 'url-loader?limit=8192',
include: [path.resolve(__dirname, 'app')],
exclude: /node_modules/
},
{
test: /\.woff(2)?(\?v=[0-9].[0-9].[0-9])?$/,
loader: "url-loader?mimetype=application/font-woff"
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9].[0-9].[0-9])?$/,
loader: "file-loader?name=[name].[ext]",
include: [path.resolve(__dirname, 'app')],
exclude: /node_modules/
}
]
}
};