-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
58 lines (57 loc) · 1.43 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
var path = require('path');
var webpack = require('webpack');
module.exports = {
context: __dirname + "/app",
entry: {
app: "./main.js",
},
output: {
path: path.join(__dirname, 'build'),
filename: 'js/[name].js',
},
resolve: {
extensions: ['', '.js', '.jsx'],
modulesDirectories: ["src/components", "node_modules"]
},
module: {
loaders: [
{
exclude: /node_modules/,
test: /\.jsx?$/,
loader: "babel-loader",
query: {
cacheDirectory: true,
presets: ['es2015', 'stage-0']
}
},
{
test: /\.eot$|\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$|\.wav$|\.mp3$|\.txt$/,
// assets for production need to be in bms-01/assets folder. This could be part of config.js but
// works fine if it is always like that
loader: "file?name=bms-01/assets/[hash]-[name].[ext]"
},
{
test: /\.txt$/,
// works fine if it is always like that
loader: "file?emitFile=false&name=[name].[ext]"
},
{
test: /\.template$/,
// works fine if it is always like that
loader: "raw-loader"
},
{
test: /\.html$/,
loader: "file?name=[name].[ext]",
},
{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
}
]
},
// context: path.join(__dirname, 'build'),
plugins: [
new webpack.EnvironmentPlugin('NODE_ENV')
]
};