forked from kpcyrd/ipfs.ink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.production.config.js
39 lines (36 loc) · 1.06 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
var Webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var AssetsPlugin = require('assets-webpack-plugin');
var path = require('path');
var assetsPath = path.resolve(__dirname, 'public', 'assets');
var entryPath = path.resolve(__dirname, 'frontend', 'app.es6.js');
var stylePath = path.resolve(__dirname, 'frontend', 'style.css');
var host = process.env.APP_HOST || 'localhost';
var config = {
devtool: 'source-map',
entry: {
'bundle.js': entryPath,
'style.css': stylePath,
},
output: {
path: assetsPath,
filename: '[hash].[name]',
},
module: {
loaders: [{
test: /\.es6\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract('css-loader?minimize')
}]
},
plugins: [
new ExtractTextPlugin({ filename: '[hash].[name]', allChunks: true }),
new AssetsPlugin(),
]
};
module.exports = config;