-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
80 lines (76 loc) · 1.93 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
80
var path = require('path');
var webpack = require("webpack");
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
require('es6-promise').polyfill();
var definePlugin = new webpack.DefinePlugin({
__DEV__: JSON.stringify(JSON.parse(process.env.BUILD_DEV || false)),
});
var dest = __dirname + '/build';
module.exports = {
entry: './src/app.jsx',
output: {
path: dest,
filename: 'bundle.js'
},
plugins: [
definePlugin,
new HtmlWebpackPlugin({
template: 'index.ejs',
filename: 'index.html',
inject: 'body'
}),
new CopyWebpackPlugin([
{ from:'manifest.json' }
])
],
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['react', 'es2015'],
plugins: ['transform-runtime']
}
},
{
test: /\.js?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['transform-runtime']
}
},
{
test: /\.html$/,
loader: "html-loader"
},
{
test: /\.css$/,
loader: "style!css"
},
{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
},
{
test: /\.md$/,
loader: "html!markdown"
},
{
test: /\.json$/,
loader: "json"
}
]
},
sassLoader: {
includePaths: [path.resolve(__dirname, "./styles")]
},
node: {
fs: "empty"
},
cache: true
};