forked from alexmingoia/pux-starter-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.production.config.js
52 lines (51 loc) · 1.42 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
46
47
48
49
50
51
52
var path = require('path');
var webpack = require('webpack');
var PurescriptWebpackPlugin = require('purescript-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: [ path.join(__dirname, 'support/index.js') ],
debug: false,
output: {
path: path.resolve('./dist'),
filename: '[name]-[hash].min.js',
publicPath: '/'
},
module: {
loaders: [
{ test: /\.purs$/, loader: 'purs-loader' },
{ test: /\.js$/, loader: "webpack-strip?strip[]=console.log" },
],
},
plugins: [
new PurescriptWebpackPlugin({
src: ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs'],
ffi: ['bower_components/purescript-*/src/**/*.js', 'src/**/*.js'],
bundle: true,
psc: 'psa'
}),
new webpack.DefinePlugin({
'process.env.WEBPACK_ENV': '"prod"',
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new webpack.optimize.OccurenceOrderPlugin(true),
new webpack.optimize.UglifyJsPlugin({ minimize: true }),
new HtmlWebpackPlugin({
template: 'support/index.html',
inject: 'body',
filename: 'index.html'
}),
new CopyWebpackPlugin([
{ from: 'static' }
]),
],
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
resolve: {
modulesDirectories: [
'node_modules',
'bower_components'
],
extensions: ['', '.js', '.purs']
}
};