Skip to content

Instantly share code, notes, and snippets.

@codewizard13
Created January 25, 2022 19:53
Show Gist options
  • Save codewizard13/cfe86b65c1d06c68758a6e2f8c10fc5c to your computer and use it in GitHub Desktop.
Save codewizard13/cfe86b65c1d06c68758a6e2f8c10fc5c to your computer and use it in GitHub Desktop.
webpack.config.js state following "Git a Web Developer Job" Udemy course, Lecture 20: hot module reload no longer works after implementing the watchFiles property
const path = require('path')
const postCSSPlugins = [
require('postcss-import'),
require('postcss-simple-vars'),
require('postcss-nested'),
require('autoprefixer')
]
module.exports = {
entry: './app/assets/scripts/App.js',
output: {
filename: 'bundled.js',
path: path.resolve(__dirname, 'app')
},
devServer: {
watchFiles: ('./app/**/*.html'),
static: path.join(__dirname, 'app'),
hot: true,
port: 3000,
// liveReload: false
},
mode: 'development',
module: {
rules: [
{
test: /\.css$/i,
use: ['style-loader','css-loader', {loader: "postcss-loader", options: {postcssOptions: {plugins: postCSSPlugins}}}]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment