Created
January 25, 2022 19:53
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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