git.iko.soy/rowtype-yoga/psfp
on e418926 help sign in
rowtype-yoga/psfp/client/webpack.dev.js
40 lines 966 B history raw
1const webpack = require('webpack');
2const merge = require('webpack-merge');
3const path = require('path');
4const common = require('./webpack.common.js');
5const HtmlWebpackPlugin = require('html-webpack-plugin');
6const isWebpackDevServer = process.argv.some(a => path.basename(a) === 'webpack-dev-server');
7const isWatch = process.argv.some(a => a === '--watch');
9const plugins =
10 isWebpackDevServer || !isWatch ? [] : [
11 function(){
12 this.plugin('done', function(stats){
13 process.stderr.write(stats.toString('errors-only'));
14 });
15 }
16 ]
20module.exports = merge(common, {
21 mode: 'development',
22 devtool: 'eval-source-map',
24 devServer: {
25 contentBase: path.resolve(__dirname, 'dist'),
26 port: 4008,
27 stats: 'errors-only'
28 },
30 plugins: [
31 new webpack.LoaderOptionsPlugin({
32 debug: true
33 }),
34 new HtmlWebpackPlugin({
35 title: 'Purescript Fan Page',
36 template: 'index.html'
37 })
38 ].concat(plugins)
40});