webpack
Version:
Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
38 lines (30 loc) • 1.28 kB
JavaScript
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Haijie Xie @hai-x
*/
;
const Dependency = require("../../graph/Dependency");
const makeSerializable = require("../../util/makeSerializable");
const ESMImportSideEffectDependency = require("./ESMImportSideEffectDependency");
/** @import { LazyRole } from "../../graph/Dependency" */
/**
* The evaluation of an `export … from "..."` statement's module. It is a separate
* class rather than a flag so a lazy barrel defers it with the re-export, while an
* import declaration's evaluation stays tied to the barrel's own code.
*/
class ESMExportImportedSideEffectDependency extends ESMImportSideEffectDependency {
/**
* Returns how this dependency may be deferred when its parent module is side-effect-free (lazy barrel optimization).
* @returns {LazyRole | null} lazy classification, null when it must be processed eagerly
*/
get lazyRole() {
return Dependency.LAZY_REEXPORT_SIDE_EFFECT;
}
}
makeSerializable(
ESMExportImportedSideEffectDependency,
"webpack/lib/dependencies/esm/ESMExportImportedSideEffectDependency"
);
ESMExportImportedSideEffectDependency.Template =
ESMImportSideEffectDependency.Template;
module.exports = ESMExportImportedSideEffectDependency;