git.iko.soy/rowtype-yoga/ry-blocks
on cbfdcbf help sign in
rowtype-yoga/ry-blocks/webpack.dev.js
38 lines 1.1 kB history raw
1"use strict";
3const path = require("path");
4const { merge } = require('webpack-merge');
5const common = require('./webpack.common.js');
6const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
7const HtmlWebpackPlugin = require("html-webpack-plugin");
9module.exports = merge(common, {
10 mode: 'development',
12 // The JavaScript file to be injected into the HTML file
13 entry: path.resolve(__dirname, "index.dev.js"),
15 devtool: 'inline-source-map',
17 // This plugin updates React components without losing their state
18 plugins: [
19 new ReactRefreshWebpackPlugin(),
21 // This plugin allows us to use a HTML file template.
22 // In the settings we specify its title and 'entry'
23 // specifies a script to be injected into the template
24 new HtmlWebpackPlugin({
25 title: "PureScript Starter",
26 template: path.resolve(__dirname, "src", "index.html"),
27 })
28 ],
30 devServer: {
31 contentBase: path.join(__dirname, 'dist'),
32 historyApiFallback: true,
33 compress: true,
34 port: 9000,
35 hotOnly: true,
36 hot: true,
37 },
38});