123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455 |
- const serial = require('../util/serial');
- const relateContext = require('../util/relate-context');
- const LocalModule = require('webpack/lib/dependencies/LocalModule');
- function flattenPrototype(obj) {
- if (typeof obj === 'string') {
- return obj;
- }
- const copy = {};
- for (const key in obj) {
- copy[key] = obj[key];
- }
- return copy;
- }
- const assignTruthful = {
- freeze(arg, dependency) {
- return arg;
- },
- thaw(arg, frozen) {
- return arg;
- },
- };
- const assignDefined = {
- freeze(arg, dependency) {
- if (typeof arg !== 'undefined') {
- return arg;
- }
- },
- thaw(arg, frozen) {
- if (typeof arg !== 'undefined') {
- return arg;
- }
- },
- }
- const optional = serial.assigned({
- prepend: assignTruthful,
- replaces: assignTruthful,
- critical: assignTruthful,
- namespaceObjectAsContext: assignDefined,
- callArgs: assignDefined,
- call: assignDefined,
- directImport: assignDefined,
- shorthand: assignDefined,
- optional: assignTruthful,
- loc: {
- freeze(arg, dependency) {
- return flattenPrototype(dependency.loc);
- },
- thaw(arg, frozen) {
- return arg;
- },
- },
- });
- const localModuleAssigned = {
- freeze(_, dependency) {
- if (
- typeof dependency.localModule === 'object' &&
- dependency.localModule !== null
- ) {
- return {
- name: dependency.localModule.name,
- idx: dependency.localModule.idx,
- used: dependency.localModule.used,
- };
- }
- },
- thaw(thawed, localModule, extra) {
- const state = extra.state;
- if (
- typeof localModule === 'object' &&
- localModule !== null
- ) {
- if (!state.localModules) {
- state.localModules = [];
- }
- if (!state.localModules[localModule.idx]) {
- state.localModules[localModule.idx] = new LocalModule(
- extra.module,
- localModule.name,
- localModule.idx,
- );
- state.localModules[localModule.idx].used =
- localModule.used;
- }
- thawed.localModule = state.localModules[localModule.idx];
- }
- return thawed;
- },
- };
- const warnings = {
- freeze(frozen, dependency) {
- if (frozen && dependency.getWarnings) {
- const warnings = dependency.getWarnings();
- if (warnings && warnings.length) {
- return warnings.map(
- ({ stack }) =>
- stack.includes('\n at Object.freeze')
- ? stack.split('\n at Object.freeze')[0]
- : stack.includes('\n at pluginCompat.tap')
- ? stack.split('\n at pluginCompat.tap')[0]
- : stack.split('\n at Compiler.pluginCompat.tap')[0],
- );
- }
- }
- },
- thaw(dependency, warnings) {
- if (dependency && warnings && dependency.getWarnings) {
- const frozenWarnings = warnings;
- const _getWarnings = dependency.getWarnings;
- dependency.getWarnings = function() {
- const warnings = _getWarnings.call(this);
- if (warnings && warnings.length) {
- return warnings.map((warning, i) => {
- const stack = warning.stack.split(
- '\n at Compilation.reportDependencyErrorsAndWarnings',
- )[1];
- warning.stack = `${
- frozenWarnings[i]
- }\n at Compilation.reportDependencyErrorsAndWarnings${stack}`;
- return warning;
- });
- }
- return warnings;
- };
- }
- return dependency;
- },
- };
- const AMDDefineDependency = require('webpack/lib/dependencies/AMDDefineDependency');
- const AMDDefineDependencySerial = serial.serial('AMDDefineDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- range: dependency.range,
- arrayRange: dependency.arrayRange,
- functionRange: dependency.functionRange,
- objectRange: dependency.objectRange,
- namedModule: dependency.namedModule,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new AMDDefineDependency(
- frozen.range,
- frozen.arrayRange,
- frozen.functionRange,
- frozen.objectRange,
- frozen.namedModule,
- );
- },
- },
- optional,
- localModuleAssigned,
- warnings,
- });
- const AMDRequireArrayDependency = require('webpack/lib/dependencies/AMDRequireArrayDependency');
- const AMDRequireArrayDependencySerial = serial.serial('AMDRequireArrayDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- depsArray: methods.mapFreeze('Dependency', null, dependency.depsArray, extra),
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new AMDRequireArrayDependency(
- methods.mapThaw('Dependency', null, frozen.depsArray, extra),
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const AMDRequireContextDependency = require('webpack/lib/dependencies/AMDRequireContextDependency');
- const AMDRequireContextDependencySerial = serial.serial('AMDRequireContextDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- options: dependency.options.regExp ?
- Object.assign({}, dependency.options, {
- regExp: dependency.options.regExp.source,
- }) :
- dependency.options,
- range: dependency.range,
- valueRange: dependency.valueRange,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new AMDRequireContextDependency(
- frozen.options.regExp ?
- Object.assign({}, frozen.options, {
- regExp: new RegExp(frozen.options.regExp),
- }) :
- frozen.options,
- frozen.range,
- frozen.valueRange,
- );
- },
- },
- optional,
- warnings,
- });
- const AMDRequireDependency = require('webpack/lib/dependencies/AMDRequireDependency');
- const AMDRequireDependencySerial = serial.serial('AMDRequireDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- block: !dependency.block.dependencies.includes(dependency) ?
- methods.freeze('DependencyBlock', null, dependency.block, extra) :
- undefined,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new AMDRequireDependency(
- !frozen.block ? extra.parent : methods.thaw('DependencyBlock', null, frozen.block, extra),
- );
- },
- },
- optional,
- warnings,
- });
- const AMDRequireItemDependency = require('webpack/lib/dependencies/AMDRequireItemDependency');
- const AMDRequireItemDependencySerial = serial.serial('AMDRequireItemDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new AMDRequireItemDependency(
- frozen.request,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const CommonJsRequireContextDependency = require('webpack/lib/dependencies/CommonJsRequireContextDependency');
- const CommonJsRequireContextDependencySerial = serial.serial('CommonJsRequireContextDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- options: dependency.options.regExp ?
- Object.assign({}, dependency.options, {
- regExp: dependency.options.regExp.source,
- }) :
- dependency.options,
- range: dependency.range,
- valueRange: dependency.valueRange,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new CommonJsRequireContextDependency(
- frozen.options.regExp ?
- Object.assign({}, frozen.options, {
- regExp: new RegExp(frozen.options.regExp),
- }) :
- frozen.options,
- frozen.range,
- frozen.valueRange,
- );
- },
- },
- optional,
- warnings,
- });
- const CommonJsRequireDependency = require('webpack/lib/dependencies/CommonJsRequireDependency');
- const CommonJsRequireDependencySerial = serial.serial('CommonJsRequireDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new CommonJsRequireDependency(
- frozen.request,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const ConstDependency = require('webpack/lib/dependencies/ConstDependency');
- const ConstDependencySerial = serial.serial('ConstDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- expression: dependency.expression,
- range: dependency.range,
- requireWebpackRequire: dependency.requireWebpackRequire,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ConstDependency(
- frozen.expression,
- frozen.range,
- frozen.requireWebpackRequire,
- );
- },
- },
- optional,
- warnings,
- });
- const ContextDependency = require('webpack/lib/dependencies/ContextDependency');
- const ContextDependencySerial = serial.serial('ContextDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- options: dependency.options.regExp ?
- Object.assign({}, dependency.options, {
- regExp: dependency.options.regExp.source,
- }) :
- dependency.options,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ContextDependency(
- frozen.options.regExp ?
- Object.assign({}, frozen.options, {
- regExp: new RegExp(frozen.options.regExp),
- }) :
- frozen.options,
- );
- },
- },
- optional,
- warnings,
- });
- const ContextElementDependency = require('webpack/lib/dependencies/ContextElementDependency');
- const ContextElementDependencySerial = serial.serial('ContextElementDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- userRequest: relateContext.relateAbsoluteRequest(extra.module.context, dependency.userRequest),
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ContextElementDependency(
- frozen.request,
- frozen.userRequest,
- );
- },
- },
- optional,
- warnings,
- });
- const CriticalDependencyWarning = require('webpack/lib/dependencies/CriticalDependencyWarning');
- const CriticalDependencyWarningSerial = serial.serial('CriticalDependencyWarning', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- message: dependency.message,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new CriticalDependencyWarning(
- frozen.message,
- );
- },
- },
- optional,
- warnings,
- });
- const DelegatedExportsDependency = require('webpack/lib/dependencies/DelegatedExportsDependency');
- const DelegatedExportsDependencySerial = serial.serial('DelegatedExportsDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- originModule: null,
- exports: dependency.exports,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new DelegatedExportsDependency(
- extra.module,
- frozen.exports,
- );
- },
- },
- optional,
- warnings,
- });
- const DelegatedSourceDependency = require('webpack/lib/dependencies/DelegatedSourceDependency');
- const DelegatedSourceDependencySerial = serial.serial('DelegatedSourceDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new DelegatedSourceDependency(
- frozen.request,
- );
- },
- },
- optional,
- warnings,
- });
- const DllEntryDependency = require('webpack/lib/dependencies/DllEntryDependency');
- const DllEntryDependencySerial = serial.serial('DllEntryDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- dependencies: methods.mapFreeze('Dependency', null, dependency.dependencies, extra),
- name: dependency.name,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new DllEntryDependency(
- methods.mapThaw('Dependency', null, frozen.dependencies, extra),
- frozen.name,
- );
- },
- },
- optional,
- warnings,
- });
- const HarmonyAcceptDependency = require('webpack/lib/dependencies/HarmonyAcceptDependency');
- const HarmonyAcceptDependencySerial = serial.serial('HarmonyAcceptDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- range: dependency.range,
- dependencies: methods.mapFreeze('Dependency', null, dependency.dependencies, extra),
- hasCallback: dependency.hasCallback,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new HarmonyAcceptDependency(
- frozen.range,
- methods.mapThaw('Dependency', null, frozen.dependencies, extra),
- frozen.hasCallback,
- );
- },
- },
- optional,
- warnings,
- });
- const HarmonyAcceptImportDependency = require('webpack/lib/dependencies/HarmonyAcceptImportDependency');
- const HarmonyAcceptImportDependencySerial = serial.serial('HarmonyAcceptImportDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- originModule: null,
- parserScope: null,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- extra.state.harmonyParserScope = extra.state.harmonyParserScope || {};
- return new HarmonyAcceptImportDependency(
- frozen.request,
- extra.module,
- extra.state.harmonyParserScope,
- );
- },
- },
- optional,
- warnings,
- });
- const HarmonyCompatibilityDependency = require('webpack/lib/dependencies/HarmonyCompatibilityDependency');
- const HarmonyCompatibilityDependencySerial = serial.serial('HarmonyCompatibilityDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- originModule: null,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new HarmonyCompatibilityDependency(
- extra.module,
- );
- },
- },
- optional,
- warnings,
- });
- const HarmonyExportExpressionDependency = require('webpack/lib/dependencies/HarmonyExportExpressionDependency');
- const HarmonyExportExpressionDependencySerial = serial.serial('HarmonyExportExpressionDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- originModule: null,
- range: dependency.range,
- rangeStatement: dependency.rangeStatement,
- prefix: dependency.prefix,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new HarmonyExportExpressionDependency(
- extra.module,
- frozen.range,
- frozen.rangeStatement,
- frozen.prefix,
- );
- },
- },
- optional,
- warnings,
- });
- const HarmonyExportHeaderDependency = require('webpack/lib/dependencies/HarmonyExportHeaderDependency');
- const HarmonyExportHeaderDependencySerial = serial.serial('HarmonyExportHeaderDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- range: dependency.range,
- rangeStatement: dependency.rangeStatement,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new HarmonyExportHeaderDependency(
- frozen.range,
- frozen.rangeStatement,
- );
- },
- },
- optional,
- warnings,
- });
- const HarmonyExportImportedSpecifierDependency = require('webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency');
- const HarmonyExportImportedSpecifierDependencySerial = serial.serial('HarmonyExportImportedSpecifierDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- originModule: null,
- sourceOrder: dependency.sourceOrder,
- parserScope: null,
- id: dependency.id,
- name: dependency.name,
- activeExports: null,
- otherStarExports: dependency.otherStarExports ? 'star' : null,
- strictExportPresence: dependency.strictExportPresence,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- extra.state.harmonyParserScope = extra.state.harmonyParserScope || {};
- extra.state.activeExports = extra.state.activeExports || new Set();
- if (frozen.name) {
- extra.state.activeExports.add(frozen.name);
- }
- return new HarmonyExportImportedSpecifierDependency(
- frozen.request,
- extra.module,
- frozen.sourceOrder,
- extra.state.harmonyParserScope,
- frozen.id,
- frozen.name,
- extra.state.activeExports,
- frozen.otherStarExports === 'star' ?
- (extra.state.otherStarExports || []) :
- null,
- frozen.strictExportPresence,
- );
- },
- },
- optional,
- warnings,
- exportImportedDependency: {
- freeze(frozen) {},
- thaw(thawed, frozen, extra) {
- if (thawed.otherStarExports) {
- extra.state.otherStarExports = (
- extra.state.otherStarExports || []
- ).concat(thawed);
- }
- return thawed;
- },
- },
- });
- const HarmonyExportSpecifierDependency = require('webpack/lib/dependencies/HarmonyExportSpecifierDependency');
- const HarmonyExportSpecifierDependencySerial = serial.serial('HarmonyExportSpecifierDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- originModule: null,
- id: dependency.id,
- name: dependency.name,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new HarmonyExportSpecifierDependency(
- extra.module,
- frozen.id,
- frozen.name,
- );
- },
- },
- optional,
- warnings,
- });
- const HarmonyImportDependency = require('webpack/lib/dependencies/HarmonyImportDependency');
- const HarmonyImportDependencySerial = serial.serial('HarmonyImportDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- originModule: null,
- sourceOrder: dependency.sourceOrder,
- parserScope: null,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- extra.state.harmonyParserScope = extra.state.harmonyParserScope || {};
- return new HarmonyImportDependency(
- frozen.request,
- extra.module,
- frozen.sourceOrder,
- extra.state.harmonyParserScope,
- );
- },
- },
- optional,
- warnings,
- importDependency: {
- freeze(frozen) {
- return frozen;
- },
- thaw(thawed, frozen, extra) {
- const state = extra.state;
- const ref = frozen.range.toString();
- if (state.imports[ref]) {
- return state.imports[ref];
- }
- state.imports[ref] = thawed;
- return thawed;
- },
- },
- });
- const HarmonyImportSideEffectDependency = require('webpack/lib/dependencies/HarmonyImportSideEffectDependency');
- const HarmonyImportSideEffectDependencySerial = serial.serial('HarmonyImportSideEffectDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- originModule: null,
- sourceOrder: dependency.sourceOrder,
- parserScope: null,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- extra.state.harmonyParserScope = extra.state.harmonyParserScope || {};
- return new HarmonyImportSideEffectDependency(
- frozen.request,
- extra.module,
- frozen.sourceOrder,
- extra.state.harmonyParserScope,
- );
- },
- },
- optional,
- warnings,
- });
- const HarmonyImportSpecifierDependency = require('webpack/lib/dependencies/HarmonyImportSpecifierDependency');
- const HarmonyImportSpecifierDependencySerial = serial.serial('HarmonyImportSpecifierDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- originModule: null,
- sourceOrder: dependency.sourceOrder,
- parserScope: null,
- id: dependency.id,
- name: dependency.name,
- range: dependency.range,
- strictExportPresence: dependency.strictExportPresence,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- extra.state.harmonyParserScope = extra.state.harmonyParserScope || {};
- return new HarmonyImportSpecifierDependency(
- frozen.request,
- extra.module,
- frozen.sourceOrder,
- extra.state.harmonyParserScope,
- frozen.id,
- frozen.name,
- frozen.range,
- frozen.strictExportPresence,
- );
- },
- },
- optional,
- warnings,
- });
- const HarmonyInitDependency = require('webpack/lib/dependencies/HarmonyInitDependency');
- const HarmonyInitDependencySerial = serial.serial('HarmonyInitDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- originModule: null,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new HarmonyInitDependency(
- extra.module,
- );
- },
- },
- optional,
- warnings,
- });
- const ImportContextDependency = require('webpack/lib/dependencies/ImportContextDependency');
- const ImportContextDependencySerial = serial.serial('ImportContextDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- options: dependency.options.regExp ?
- Object.assign({}, dependency.options, {
- regExp: dependency.options.regExp.source,
- }) :
- dependency.options,
- range: dependency.range,
- valueRange: dependency.valueRange,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ImportContextDependency(
- frozen.options.regExp ?
- Object.assign({}, frozen.options, {
- regExp: new RegExp(frozen.options.regExp),
- }) :
- frozen.options,
- frozen.range,
- frozen.valueRange,
- );
- },
- },
- optional,
- warnings,
- });
- const ImportDependency = require('webpack/lib/dependencies/ImportDependency');
- const ImportDependencySerial = serial.serial('ImportDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- originModule: null,
- block: !dependency.block.dependencies.includes(dependency) ?
- methods.freeze('DependencyBlock', null, dependency.block, extra) :
- undefined,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ImportDependency(
- frozen.request,
- extra.module,
- !frozen.block ? extra.parent : methods.thaw('DependencyBlock', null, frozen.block, extra),
- );
- },
- },
- optional,
- warnings,
- });
- const ImportEagerDependency = require('webpack/lib/dependencies/ImportEagerDependency');
- const ImportEagerDependencySerial = serial.serial('ImportEagerDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- originModule: null,
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ImportEagerDependency(
- frozen.request,
- extra.module,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const ImportWeakDependency = require('webpack/lib/dependencies/ImportWeakDependency');
- const ImportWeakDependencySerial = serial.serial('ImportWeakDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- originModule: null,
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ImportWeakDependency(
- frozen.request,
- extra.module,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const JsonExportsDependency = require('webpack/lib/dependencies/JsonExportsDependency');
- const JsonExportsDependencySerial = serial.serial('JsonExportsDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- exports: dependency.exports,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new JsonExportsDependency(
- frozen.exports,
- );
- },
- },
- optional,
- warnings,
- });
- const LoaderDependency = require('webpack/lib/dependencies/LoaderDependency');
- const LoaderDependencySerial = serial.serial('LoaderDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new LoaderDependency(
- frozen.request,
- );
- },
- },
- optional,
- warnings,
- });
- const LocalModuleDependency = require('webpack/lib/dependencies/LocalModuleDependency');
- const LocalModuleDependencySerial = serial.serial('LocalModuleDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- localModule: {
- name: dependency.localModule.name,
- name: dependency.localModule.idx,
- },
- range: dependency.range,
- callNew: dependency.callNew,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- if (!extra.state.localModules) {
- extra.state.localModules = [];
- }
- if (!extra.state.localModules[frozen.localModule.idx]) {
- extra.state.localModules[frozen.localModule.idx] = new LocalModule(extra.module, frozen.localModule.name, frozen.localModule.idx);
- extra.state.localModules[frozen.localModule.idx].used = frozen.localModule.used;
- }
- return new LocalModuleDependency(
- extra.state.localModules[frozen.localModule.idx],
- frozen.range,
- frozen.callNew,
- );
- },
- },
- optional,
- localModuleAssigned,
- warnings,
- });
- const ModuleDependency = require('webpack/lib/dependencies/ModuleDependency');
- const ModuleDependencySerial = serial.serial('ModuleDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ModuleDependency(
- frozen.request,
- );
- },
- },
- optional,
- warnings,
- });
- const ModuleHotAcceptDependency = require('webpack/lib/dependencies/ModuleHotAcceptDependency');
- const ModuleHotAcceptDependencySerial = serial.serial('ModuleHotAcceptDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ModuleHotAcceptDependency(
- frozen.request,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const ModuleHotDeclineDependency = require('webpack/lib/dependencies/ModuleHotDeclineDependency');
- const ModuleHotDeclineDependencySerial = serial.serial('ModuleHotDeclineDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new ModuleHotDeclineDependency(
- frozen.request,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const MultiEntryDependency = require('webpack/lib/dependencies/MultiEntryDependency');
- const MultiEntryDependencySerial = serial.serial('MultiEntryDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- dependencies: methods.mapFreeze('Dependency', null, dependency.dependencies, extra),
- name: dependency.name,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new MultiEntryDependency(
- methods.mapThaw('Dependency', null, frozen.dependencies, extra),
- frozen.name,
- );
- },
- },
- optional,
- warnings,
- });
- const NullDependency = require('webpack/lib/dependencies/NullDependency');
- const NullDependencySerial = serial.serial('NullDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new NullDependency(
- );
- },
- },
- optional,
- warnings,
- });
- const PrefetchDependency = require('webpack/lib/dependencies/PrefetchDependency');
- const PrefetchDependencySerial = serial.serial('PrefetchDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new PrefetchDependency(
- frozen.request,
- );
- },
- },
- optional,
- warnings,
- });
- const RequireContextDependency = require('webpack/lib/dependencies/RequireContextDependency');
- const RequireContextDependencySerial = serial.serial('RequireContextDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- options: dependency.options.regExp ?
- Object.assign({}, dependency.options, {
- regExp: dependency.options.regExp.source,
- }) :
- dependency.options,
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new RequireContextDependency(
- frozen.options.regExp ?
- Object.assign({}, frozen.options, {
- regExp: new RegExp(frozen.options.regExp),
- }) :
- frozen.options,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const RequireEnsureDependency = require('webpack/lib/dependencies/RequireEnsureDependency');
- const RequireEnsureDependencySerial = serial.serial('RequireEnsureDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- block: !dependency.block.dependencies.includes(dependency) ?
- methods.freeze('DependencyBlock', null, dependency.block, extra) :
- undefined,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new RequireEnsureDependency(
- !frozen.block ? extra.parent : methods.thaw('DependencyBlock', null, frozen.block, extra),
- );
- },
- },
- optional,
- warnings,
- });
- const RequireEnsureItemDependency = require('webpack/lib/dependencies/RequireEnsureItemDependency');
- const RequireEnsureItemDependencySerial = serial.serial('RequireEnsureItemDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new RequireEnsureItemDependency(
- frozen.request,
- );
- },
- },
- optional,
- warnings,
- });
- const RequireHeaderDependency = require('webpack/lib/dependencies/RequireHeaderDependency');
- const RequireHeaderDependencySerial = serial.serial('RequireHeaderDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new RequireHeaderDependency(
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const RequireIncludeDependency = require('webpack/lib/dependencies/RequireIncludeDependency');
- const RequireIncludeDependencySerial = serial.serial('RequireIncludeDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new RequireIncludeDependency(
- frozen.request,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const RequireResolveContextDependency = require('webpack/lib/dependencies/RequireResolveContextDependency');
- const RequireResolveContextDependencySerial = serial.serial('RequireResolveContextDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- options: dependency.options.regExp ?
- Object.assign({}, dependency.options, {
- regExp: dependency.options.regExp.source,
- }) :
- dependency.options,
- range: dependency.range,
- valueRange: dependency.valueRange,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new RequireResolveContextDependency(
- frozen.options.regExp ?
- Object.assign({}, frozen.options, {
- regExp: new RegExp(frozen.options.regExp),
- }) :
- frozen.options,
- frozen.range,
- frozen.valueRange,
- );
- },
- },
- optional,
- warnings,
- });
- const RequireResolveDependency = require('webpack/lib/dependencies/RequireResolveDependency');
- const RequireResolveDependencySerial = serial.serial('RequireResolveDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new RequireResolveDependency(
- frozen.request,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const RequireResolveHeaderDependency = require('webpack/lib/dependencies/RequireResolveHeaderDependency');
- const RequireResolveHeaderDependencySerial = serial.serial('RequireResolveHeaderDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new RequireResolveHeaderDependency(
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const SingleEntryDependency = require('webpack/lib/dependencies/SingleEntryDependency');
- const SingleEntryDependencySerial = serial.serial('SingleEntryDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new SingleEntryDependency(
- frozen.request,
- );
- },
- },
- optional,
- warnings,
- });
- const UnsupportedDependency = require('webpack/lib/dependencies/UnsupportedDependency');
- const UnsupportedDependencySerial = serial.serial('UnsupportedDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- range: dependency.range,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new UnsupportedDependency(
- frozen.request,
- frozen.range,
- );
- },
- },
- optional,
- warnings,
- });
- const WebAssemblyImportDependency = require('webpack/lib/dependencies/WebAssemblyImportDependency');
- const WebAssemblyImportDependencySerial = serial.serial('WebAssemblyImportDependency', {
- constructor: {
- freeze(_, dependency, extra, methods) {
- return {
- request: relateContext.relateAbsoluteRequest(extra.module.context, dependency.request),
- name: dependency.name,
- description: dependency.description,
- onlyDirectImport: dependency.onlyDirectImport,
- };
- },
- thaw(thawed, frozen, extra, methods) {
- return new WebAssemblyImportDependency(
- frozen.request,
- frozen.name,
- frozen.description,
- frozen.onlyDirectImport,
- );
- },
- },
- optional,
- warnings,
- });
- exports.map = new Map();
- exports.AMDDefineDependency = AMDDefineDependencySerial;
- exports.map.set(AMDDefineDependency, AMDDefineDependencySerial);
- exports.AMDRequireArrayDependency = AMDRequireArrayDependencySerial;
- exports.map.set(AMDRequireArrayDependency, AMDRequireArrayDependencySerial);
- exports.AMDRequireContextDependency = AMDRequireContextDependencySerial;
- exports.map.set(AMDRequireContextDependency, AMDRequireContextDependencySerial);
- exports.AMDRequireDependency = AMDRequireDependencySerial;
- exports.map.set(AMDRequireDependency, AMDRequireDependencySerial);
- exports.AMDRequireItemDependency = AMDRequireItemDependencySerial;
- exports.map.set(AMDRequireItemDependency, AMDRequireItemDependencySerial);
- exports.CommonJsRequireContextDependency = CommonJsRequireContextDependencySerial;
- exports.map.set(CommonJsRequireContextDependency, CommonJsRequireContextDependencySerial);
- exports.CommonJsRequireDependency = CommonJsRequireDependencySerial;
- exports.map.set(CommonJsRequireDependency, CommonJsRequireDependencySerial);
- exports.ConstDependency = ConstDependencySerial;
- exports.map.set(ConstDependency, ConstDependencySerial);
- exports.ContextDependency = ContextDependencySerial;
- exports.map.set(ContextDependency, ContextDependencySerial);
- exports.ContextElementDependency = ContextElementDependencySerial;
- exports.map.set(ContextElementDependency, ContextElementDependencySerial);
- exports.CriticalDependencyWarning = CriticalDependencyWarningSerial;
- exports.map.set(CriticalDependencyWarning, CriticalDependencyWarningSerial);
- exports.DelegatedExportsDependency = DelegatedExportsDependencySerial;
- exports.map.set(DelegatedExportsDependency, DelegatedExportsDependencySerial);
- exports.DelegatedSourceDependency = DelegatedSourceDependencySerial;
- exports.map.set(DelegatedSourceDependency, DelegatedSourceDependencySerial);
- exports.DllEntryDependency = DllEntryDependencySerial;
- exports.map.set(DllEntryDependency, DllEntryDependencySerial);
- exports.HarmonyAcceptDependency = HarmonyAcceptDependencySerial;
- exports.map.set(HarmonyAcceptDependency, HarmonyAcceptDependencySerial);
- exports.HarmonyAcceptImportDependency = HarmonyAcceptImportDependencySerial;
- exports.map.set(HarmonyAcceptImportDependency, HarmonyAcceptImportDependencySerial);
- exports.HarmonyCompatibilityDependency = HarmonyCompatibilityDependencySerial;
- exports.map.set(HarmonyCompatibilityDependency, HarmonyCompatibilityDependencySerial);
- exports.HarmonyExportExpressionDependency = HarmonyExportExpressionDependencySerial;
- exports.map.set(HarmonyExportExpressionDependency, HarmonyExportExpressionDependencySerial);
- exports.HarmonyExportHeaderDependency = HarmonyExportHeaderDependencySerial;
- exports.map.set(HarmonyExportHeaderDependency, HarmonyExportHeaderDependencySerial);
- exports.HarmonyExportImportedSpecifierDependency = HarmonyExportImportedSpecifierDependencySerial;
- exports.map.set(HarmonyExportImportedSpecifierDependency, HarmonyExportImportedSpecifierDependencySerial);
- exports.HarmonyExportSpecifierDependency = HarmonyExportSpecifierDependencySerial;
- exports.map.set(HarmonyExportSpecifierDependency, HarmonyExportSpecifierDependencySerial);
- exports.HarmonyImportDependency = HarmonyImportDependencySerial;
- exports.map.set(HarmonyImportDependency, HarmonyImportDependencySerial);
- exports.HarmonyImportSideEffectDependency = HarmonyImportSideEffectDependencySerial;
- exports.map.set(HarmonyImportSideEffectDependency, HarmonyImportSideEffectDependencySerial);
- exports.HarmonyImportSpecifierDependency = HarmonyImportSpecifierDependencySerial;
- exports.map.set(HarmonyImportSpecifierDependency, HarmonyImportSpecifierDependencySerial);
- exports.HarmonyInitDependency = HarmonyInitDependencySerial;
- exports.map.set(HarmonyInitDependency, HarmonyInitDependencySerial);
- exports.ImportContextDependency = ImportContextDependencySerial;
- exports.map.set(ImportContextDependency, ImportContextDependencySerial);
- exports.ImportDependency = ImportDependencySerial;
- exports.map.set(ImportDependency, ImportDependencySerial);
- exports.ImportEagerDependency = ImportEagerDependencySerial;
- exports.map.set(ImportEagerDependency, ImportEagerDependencySerial);
- exports.ImportWeakDependency = ImportWeakDependencySerial;
- exports.map.set(ImportWeakDependency, ImportWeakDependencySerial);
- exports.JsonExportsDependency = JsonExportsDependencySerial;
- exports.map.set(JsonExportsDependency, JsonExportsDependencySerial);
- exports.LoaderDependency = LoaderDependencySerial;
- exports.map.set(LoaderDependency, LoaderDependencySerial);
- exports.LocalModuleDependency = LocalModuleDependencySerial;
- exports.map.set(LocalModuleDependency, LocalModuleDependencySerial);
- exports.ModuleDependency = ModuleDependencySerial;
- exports.map.set(ModuleDependency, ModuleDependencySerial);
- exports.ModuleHotAcceptDependency = ModuleHotAcceptDependencySerial;
- exports.map.set(ModuleHotAcceptDependency, ModuleHotAcceptDependencySerial);
- exports.ModuleHotDeclineDependency = ModuleHotDeclineDependencySerial;
- exports.map.set(ModuleHotDeclineDependency, ModuleHotDeclineDependencySerial);
- exports.MultiEntryDependency = MultiEntryDependencySerial;
- exports.map.set(MultiEntryDependency, MultiEntryDependencySerial);
- exports.NullDependency = NullDependencySerial;
- exports.map.set(NullDependency, NullDependencySerial);
- exports.PrefetchDependency = PrefetchDependencySerial;
- exports.map.set(PrefetchDependency, PrefetchDependencySerial);
- exports.RequireContextDependency = RequireContextDependencySerial;
- exports.map.set(RequireContextDependency, RequireContextDependencySerial);
- exports.RequireEnsureDependency = RequireEnsureDependencySerial;
- exports.map.set(RequireEnsureDependency, RequireEnsureDependencySerial);
- exports.RequireEnsureItemDependency = RequireEnsureItemDependencySerial;
- exports.map.set(RequireEnsureItemDependency, RequireEnsureItemDependencySerial);
- exports.RequireHeaderDependency = RequireHeaderDependencySerial;
- exports.map.set(RequireHeaderDependency, RequireHeaderDependencySerial);
- exports.RequireIncludeDependency = RequireIncludeDependencySerial;
- exports.map.set(RequireIncludeDependency, RequireIncludeDependencySerial);
- exports.RequireResolveContextDependency = RequireResolveContextDependencySerial;
- exports.map.set(RequireResolveContextDependency, RequireResolveContextDependencySerial);
- exports.RequireResolveDependency = RequireResolveDependencySerial;
- exports.map.set(RequireResolveDependency, RequireResolveDependencySerial);
- exports.RequireResolveHeaderDependency = RequireResolveHeaderDependencySerial;
- exports.map.set(RequireResolveHeaderDependency, RequireResolveHeaderDependencySerial);
- exports.SingleEntryDependency = SingleEntryDependencySerial;
- exports.map.set(SingleEntryDependency, SingleEntryDependencySerial);
- exports.UnsupportedDependency = UnsupportedDependencySerial;
- exports.map.set(UnsupportedDependency, UnsupportedDependencySerial);
- exports.WebAssemblyImportDependency = WebAssemblyImportDependencySerial;
- exports.map.set(WebAssemblyImportDependency, WebAssemblyImportDependencySerial);
|