forked from GoogleChromeLabs/worker-plugin
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
parser.hooks.new.for('imported var').tap(NAME, expr => {
if (expr.callee.name !== 'Worker') return falseCan be changed to this, because 'imported var' is not supported.
parser.hooks.new.for('Worker').tap(NAME, function (expr) {But still get TypeError: ParserHelpers.addParsedVariableToModule is not a function, and I searched issue GoogleChromeLabs#88 seems have a workaround, but ParserHelpers.getModulePath is gone too:
this update is useless
ParserHelpers.addParsedVariableToModule(parser, id, req);to
let ModuleDecoratorDependency;
try {
ModuleDecoratorDependency = require("webpack/lib/dependencies/ModuleDecoratorDependency");
} catch (e) {}
// ...
if (ModuleDecoratorDependency) {
const dep = new ModuleDecoratorDependency(
ParserHelpers.getModulePath(parser.state.module.context, req),
parser.state.module
);
dep.loc = expr.loc;
parser.state.module.addDependency(dep);
} else {
ParserHelpers.addParsedVariableToModule(parser, id, req);
}Nantris
Metadata
Metadata
Assignees
Labels
No labels