Closed justjake closed 4 years ago
+1, same issue. Thanks to jake for finding the problem.
Having the same issue too. Took some time to figure that this is the issue.
Use the https://www.npmjs.com/package/strict-loader
module: {
loaders: [
{
test: /./,
loader: 'strict!imports-loader?define=>false',
},
]
}
Context
somewhere in my dependency graph, I have a file with a format like this:
If webpack parses this without
imports-loader?define=>false
, then it tries to resolve a bunch of AMD modules that I don't have, since I am usingnpm
and commonjs. So I have this in my config file:Issue
However, I see that imports-loader is inserting variables before any
"use strict";
directives in my modules or my dependencies:is there a better way to disable AMD in webpack? Is there a way to move "use strict"; above the imports-injected variables?