From ca08860b2f5668910f8e5a0948bf2a2019d1bcd4 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Fri, 14 Feb 2020 23:12:52 -0700 Subject: [PATCH] run elm debug mode stuff --- webpack.config.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 7225085..5d53935 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -10,6 +10,7 @@ const FaviconsWebpackPlugin = require('favicons-webpack-plugin') const { JSDOM } = require('jsdom') const tempy = require('tempy') const fs = require('fs') +const webpack = require('webpack') const magicFile = (text) => { const p = tempy.file() @@ -110,6 +111,7 @@ const productionPlugins = [ ]; let plugins = (env, argv) => [ + new webpack.HotModuleReplacementPlugin(), new CopyPlugin([{ from: 'data', to: 'data' }, { from: 'wand.js', to: 'wand.js' }]), new HtmlWebpackPlugin({ hash: true, @@ -145,11 +147,17 @@ module.exports = (env, argv) => ({ test: /\.elm$/, exclude: [/elm-stuff/, /node_modules/], use: [ - { loader: 'elm-hot-webpack-loader' }, + { + loader: 'elm-hot-webpack-loader', + options: { + debug: argv.mode != 'production', + } + }, { loader: 'elm-webpack-loader', options: { - optimize: argv.mode == 'production' + optimize: argv.mode == 'production', + debug: argv.mode != 'production', }, }, ], @@ -168,6 +176,11 @@ module.exports = (env, argv) => ({ }, ], }, + devServer: { + inline: true, + hot: true, + stats: 'errors-only' + }, optimization: { minimize: argv.mode == 'production', minimizer: [