I’m following this https://www.youtube.com/watch?v=MpGLUVbqoYQ webpack tutorial precisely, and have gotten to the part of the video where he talks about content hashing. On the video he does:
const path = require("path");
module.exports = {
mode: "development",
entry: "./src/index.js",
output: {
filename: "main.[contentHash].js",
path: path.resolve(__dirnamem, "dist")
},
module: {
rules: [
{
test: /.scss$/,
use: [
"style-loader",
"css-loader",
"sass-loader"
]
}
]
}
};
I have done:
const path = require("path");
module.exports = {
mode: "development",
entry: "./src/index.js",
output: {
filename: "main.[contentHash].js",
path: path.resolve(__dirname, "dist")
},
module: {
rules: [
{
test: /.scss$/,
use: [
"style-loader", // 3. Injects styles into DOM
"css-loader", // 2. Turns css into commonjs
"sass-loader" // 1. Turns sass into css
]
}
]
}
};
On the video this code works and appends a content hash where indicated, but when I ran npm start, I got this: