Description
Operating System: Windows 10 Pro
Node Version: 14.16.1
NPM Version: 6.14.12
webpack Version: 5.37.1
webpack-dev-server Version: 4.0.0-beta.3
- This is a bug
- This is a modification request
Code
// webpack.config.js
const webpack = require('webpack');
const path = require('path');
const developmentEnvironment = 'development' ;
const productionEnvironment = 'production';
module.exports = function(env, argv) {
return {
mode: argv.mode === productionEnvironment ? productionEnvironment : developmentEnvironment,
devtool: argv.mode === productionEnvironment ? 'source-map' : 'eval-source-map',
entry: {
index: './index'
},
target: 'browserslist',
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/dist/',
filename: '[name].entry.js',
chunkFilename: '[name].chunk.js'
},
plugins: [],
resolve: {
descriptionFiles: ['package.json'],
extensions: ['.js', '.jsx', '.json', '.wasm', '...'],
modules: [
'node_modules'
],
alias: {}
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /node_modules(\/|\\)(?!(js-base64)).*/,
use: {
loader: 'babel-loader',
options: {}
}
}
]
},
devServer: {
open: true,
hot: true,
compress: true,
host: 'local.webui.com',
port: 3000,
proxy: {
'**': 'http://local.webui.com:8080'
},
}
};
};
// package.json
{
"scripts": {
"start": "webpack serve --mode development",
"build": "webpack --mode production"
},
"browserslist": [
">0.2%",
"not dead",
"not ie < 11",
"not op_mini all"
],
"devDependencies": {
"@babel/core": "^7.14.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.14.3",
"@babel/preset-env": "^7.14.2",
"@babel/runtime-corejs3": "^7.14.0",
"autoprefixer": "^10.2.5",
"babel-loader": "^8.2.2",
"core-js": "^3.12.1",
"css-loader": "^5.2.5",
"ejs-loader": "^0.5.0",
"exports-loader": "^3.0.0",
"expose-loader": "^3.0.0",
"file-loader": "^6.2.0",
"handlebars-loader": "^1.7.1",
"imports-loader": "^3.0.0",
"mini-css-extract-plugin": "^1.6.0",
"node-sass": "^6.0.0",
"postcss-loader": "^5.3.0",
"regenerator-runtime": "^0.13.7",
"sass-loader": "^11.1.1",
"script-loader": "^0.7.2",
"style-loader": "^2.0.0",
"url-loader": "^4.1.1",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0",
"webpack-dev-server": "^4.0.0-beta.3"
},
"dependencies": {
"js-base64": "^3.6.1"
}
}
// index.js
import { Base64 } from 'js-base64';
console.log(Base64.encodeURI("asfasfasgjwig%$#&$%*&@#$*43834"));
Please paste the results of webpack-cli info
here, and mention other relevant information
Expected Behavior
When writing the console.log code in the "node_modules/js-base64/base64.mjs" file, changes are detected and the screen is automatically updated.
Actual Behavior
A change is detected and a new build is made, but the console says "[webpack-dev-server] Nothing changed."
Also, the screen is not updated.
After ending the process, you must restart it for the changes to take effect.
For Bugs; How can we reproduce the behavior?
It is reproduced by writing the console.log code in the file "node_modules/js-base64/base64.mjs".
For Features; What is the motivation and/or use-case for the feature?
I frequently modify the files in the "node_modules" path for debugging. Through the link "#1970", I know that it supports change detection of the path under "node_modules" by default.
But the actual behavior is not working as I wish.
Can you help me? Thank you.