html-webpack-partials-plugin icon indicating copy to clipboard operation
html-webpack-partials-plugin copied to clipboard

Live reload

Open raloliver opened this issue 4 years ago • 2 comments

When I use serve from webpack, the live reload does not works when I change a partial file.

raloliver avatar Nov 07 '20 18:11 raloliver

hey @raloliver im guessing it's similar to this issue here? https://github.com/colbyfayock/html-webpack-partials-plugin/issues/15

this isn't currently utilizing the pipeline to effect where it could take advantage of live reload or more benefits from the full webpack / html webpack plugin system

open to ideas if you have any or are more familiar with the inner workings

colbyfayock avatar Nov 09 '20 00:11 colbyfayock

@raloliver check out https://github.com/pigcan/extra-watch-webpack-plugin. Live reload is working on the following configuration.

My directory structure:

├── /dist                    # Webpack and Tailwind output directory
│   ├── index.html              # Render of index.html template with partials
│   ├── main.js                 # Main output for Webpack/Stimulus
│   └── tailwind.css            # Main output for Tailwind
├── /src                     # Source folder
│   ├── /controllers            # Stimulus Controllers Folder
│   ├── /partials               # HTML Partials Folder
│   ├── /templates              # HTML Templates Folder
│   ├── index.js                # Webpack Entry Point
│   └── tailwind.css            # Tailwind CSS Entry Point
├── package.json             # Yarn package.json
├── postcss.config.js        # PostCSS config
├── tailwind.config.js       # Tailwind Config
├── webpack.config.js        # Webpack Config
└── yarn.lock                # Yarn Lockfile

And this is my webpack.config.js plugin:

new ExtraWatchWebpackPlugin({
    dirs: [ path.join(__dirname, 'src') ],
}),

vincenttaglia avatar Nov 28 '20 09:11 vincenttaglia