Webpack have trouble with scopes
问题 There are several modules that are connected to app.js, for example the code that is inside: var test = "TEST"; Here is my webpack.config: module.exports = { entry: './src/app.js', output: { filename: './dist/bundle.js' } }; The problem is that when I try to call my test variable in the developer console, I get an error: Something about the scope, when I connect app.js directly - everything works, what's the problem and how to fix it? 回答1: Yes, this is a scope problem. There are two ways to