LoginSignup
1
1

More than 5 years have passed since last update.

elm0.19 + webpack4 + webpack-dev-server のサンプルをdockerで試したメモ

Posted at

webpack-serveがあっという間に使われなくなったので、
webpack-dev-serverに戻したバージョンをメモしておく。

前回の記事

webpack.config.js
// 省略
if (MODE === "development") {
    console.log("Building for dev...");
    module.exports = merge(common, {
        plugins: [
            // Suggested for hot-loading
            new webpack.NamedModulesPlugin(),
            // Prevents compilation errors causing the hot loader to lose state
            new webpack.NoEmitOnErrorsPlugin()
        ],
        module: {
            rules: [
                {
                    test: /\.elm$/,
                    exclude: [/elm-stuff/, /node_modules/],
                    use: [
                        { loader: "elm-hot-webpack-loader" },
                        {
                            loader: "elm-webpack-loader",
                            options: {
                                // add Elm's debug overlay to output
                                debug: true,
                                forceWatch: true
                            }
                        }
                    ]
                }
            ]
        },
        devServer: {
            inline: true,
            stats: "errors-only",
            contentBase: path.join(__dirname, "src/assets"),
            historyApiFallback: true,
            // feel free to delete this section if you don't need anything like this
            before(app) {
                // on port 3000
                app.get("/test", function(req, res) {
                    res.json({ result: "OK" });
                });
            }
        },
        watch:true, 
        watchOptions:{
         aggregateTimeout: 300,
          poll:1000
        }
    });
}

// 省略

サンプル

  • 以下、elm-webpack-starterで色々試してみたログ

dockerで動かした時点

typescript導入時点

jquery導入時点

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1