UNPKG

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.

31 lines (23 loc) 1.03 kB
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Alexander Akait @alexander-akait */ "use strict"; const WebpackError = require("../WebpackError"); /** @typedef {{ name: string, size: number }} DynamicExportsDetails */ class DynamicExportsWarning extends WebpackError { /** * Creates an instance of DynamicExportsWarning. * @param {DynamicExportsDetails[]} modules the modules to name, largest first * @param {number} total how many were found */ constructor(modules, total) { super( `dynamic exports: webpack cannot tell what ${total} ${total === 1 ? "module exports" : "modules export"}, so nothing importing ${total === 1 ? "it" : "them"} can be tree-shaken: ${modules.map(({ name, size }) => ` ${name} (${size} bytes)`).join("\n")} Exports assigned under a condition or through a computed key cannot be read statically. For more info visit https://webpack.js.org/guides/tree-shaking/` ); this.name = "DynamicExportsWarning"; } } module.exports = DynamicExportsWarning;