@rushstack/set-webpack-public-path-plugin 4.1.3 → 4.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetPublicPathPlugin.d.ts","sourceRoot":"","sources":["../src/SetPublicPathPlugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AAOxC;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAEnD;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAmC,SAAQ,4BAA4B;IACtF;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;;WAGG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QAEvB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;;;WAIG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAoCD;;;;;GAKG;AACH,qBAAa,mBAAoB,YAAW,OAAO,CAAC,MAAM;IACjD,OAAO,EAAE,kCAAkC,CAAC;gBAEhC,OAAO,EAAE,kCAAkC;IAYvD,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI;IAgG9C,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"SetPublicPathPlugin.d.ts","sourceRoot":"","sources":["../src/SetPublicPathPlugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AAOxC;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAEnD;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAmC,SAAQ,4BAA4B;IACtF;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;;WAGG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QAEvB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;;;WAIG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAoCD;;;;;GAKG;AACH,qBAAa,mBAAoB,YAAW,OAAO,CAAC,MAAM;IACjD,OAAO,EAAE,kCAAkC,CAAC;gBAEhC,OAAO,EAAE,kCAAkC;IAYvD,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,GAAG,IAAI;IAgG9C,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,eAAe;CAgCxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetPublicPathPlugin.js","sourceRoot":"","sources":["../src/SetPublicPathPlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,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IAAA,oCAAoB,EAAC,aAAa,EAAE,OAAO,CAAC,KAAK,CAAC;YAClD,OAAO;YACP,EAAE;YACF,OAAO,CAAC,MAAM;SACf,CAAC,IAAI,CAAC,QAAG,CAAC,CAAC;IACd,CAAC;CACF;AA9JD,kDA8JC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { EOL } from 'os';\nimport { VersionDetection } from '@rushstack/webpack-plugin-utilities';\nimport { Text, PackageJsonLookup, IPackageJson } from '@rushstack/node-core-library';\n\nimport type * as Webpack from 'webpack';\nimport type * as Tapable from 'tapable';\n// Workaround for https://github.com/pnpm/pnpm/issues/4301\nimport type * as Webpack5 from '@rushstack/heft-webpack5-plugin/node_modules/webpack';\n\nimport { IInternalOptions, getSetPublicPathCode } from './codeGenerator';\n\n/**\n * The base options for setting the webpack public path at runtime.\n *\n * @public\n */\nexport interface ISetWebpackPublicPathOptions {\n /**\n * Use the System.baseURL property if it is defined.\n */\n systemJs?: boolean;\n\n /**\n * Use the specified string as a URL prefix after the SystemJS path or the publicPath option.\n * If neither systemJs nor publicPath is defined, this option will not apply and an exception will be thrown.\n */\n urlPrefix?: string;\n\n /**\n * Use the specified path as the base public path.\n */\n publicPath?: string;\n\n /**\n * Check for a variable with this name on the page and use its value as a regular expression against script paths to\n * the bundle's script. If a value foo is passed into regexVariable, the produced bundle will look for a variable\n * called foo during initialization, and if a foo variable is found, use its value as a regular expression to detect\n * the bundle's script.\n *\n * See the README for more information.\n */\n regexVariable?: string;\n\n /**\n * A function that returns a snippet of code that manipulates the variable with the name that's specified in the\n * parameter. If this parameter isn't provided, no post-processing code is included. The variable must be modified\n * in-place - the processed value should not be returned.\n *\n * See the README for more information.\n */\n getPostProcessScript?: (varName: string) => string;\n\n /**\n * If true, find the last script matching the regexVariable (if it is set). If false, find the first matching script.\n * This can be useful if there are multiple scripts loaded in the DOM that match the regexVariable.\n */\n preferLastFoundScript?: boolean;\n\n /**\n * If true, always include the public path-setting code. Don't try to detect if any chunks or assets are present.\n */\n skipDetection?: boolean;\n}\n\n/**\n * Options for the set-webpack-public-path plugin.\n *\n * @public\n */\nexport interface ISetWebpackPublicPathPluginOptions extends ISetWebpackPublicPathOptions {\n /**\n * An object that describes how the public path should be discovered.\n */\n scriptName?: {\n /**\n * If set to true, use the webpack generated asset's name. This option is not compatible with\n * andy other scriptName options.\n */\n useAssetName?: boolean;\n\n /**\n * A regular expression expressed as a string to be applied to all script paths on the page.\n */\n name?: string;\n\n /**\n * If true, the name property is tokenized.\n *\n * See the README for more information.\n */\n isTokenized?: boolean;\n };\n}\n\ninterface IAsset {\n size(): number;\n source(): string;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare const __dummyWebpack4MainTemplate: Webpack.compilation.MainTemplate;\ninterface IWebpack4ExtendedMainTemplate extends Webpack.compilation.MainTemplate {\n hooks: {\n startup: Tapable.SyncHook<string, Webpack.compilation.Chunk, string>;\n } & typeof __dummyWebpack4MainTemplate.hooks;\n}\n\nconst SHOULD_REPLACE_ASSET_NAME_TOKEN: unique symbol = Symbol(\n 'set-public-path-plugin-should-replace-asset-name'\n);\n\ninterface IExtendedChunk extends Webpack.compilation.Chunk {\n [SHOULD_REPLACE_ASSET_NAME_TOKEN]: boolean;\n}\n\ninterface IStartupCodeOptions {\n source: string;\n chunk: IExtendedChunk;\n hash: string;\n requireFn: string;\n}\n\nconst PLUGIN_NAME: string = 'set-webpack-public-path';\n\nconst ASSET_NAME_TOKEN: string = '-ASSET-NAME-c0ef4f86-b570-44d3-b210-4428c5b7825c';\n\nconst ASSET_NAME_TOKEN_REGEX: RegExp = new RegExp(ASSET_NAME_TOKEN);\n\n/**\n * This simple plugin sets the __webpack_public_path__ variable to a value specified in the arguments,\n * optionally appended to the SystemJs baseURL property.\n *\n * @public\n */\nexport class SetPublicPathPlugin implements Webpack.Plugin {\n public options: ISetWebpackPublicPathPluginOptions;\n\n public constructor(options: ISetWebpackPublicPathPluginOptions) {\n this.options = options;\n\n if (options.scriptName) {\n if (options.scriptName.useAssetName && options.scriptName.name) {\n throw new Error('scriptName.userAssetName and scriptName.name must not be used together');\n } else if (options.scriptName.isTokenized && !options.scriptName.name) {\n throw new Error('scriptName.isTokenized is only valid if scriptName.name is set');\n }\n }\n }\n\n public apply(compiler: Webpack.Compiler): void {\n // Casting here because VersionDetection refers to webpack 5 typings\n if (VersionDetection.isWebpack3OrEarlier(compiler as unknown as Webpack5.Compiler)) {\n throw new Error(`The ${SetPublicPathPlugin.name} plugin requires Webpack 4`);\n }\n\n // Casting here because VersionDetection refers to webpack 5 typings\n const isWebpack4: boolean = VersionDetection.isWebpack4(compiler as unknown as Webpack5.Compiler);\n\n compiler.hooks.compilation.tap(\n PLUGIN_NAME,\n (compilation: Webpack.compilation.Compilation | Webpack5.Compilation) => {\n if (isWebpack4) {\n const webpack4Compilation: Webpack.compilation.Compilation =\n compilation as Webpack.compilation.Compilation;\n const mainTemplate: IWebpack4ExtendedMainTemplate =\n webpack4Compilation.mainTemplate as IWebpack4ExtendedMainTemplate;\n mainTemplate.hooks.startup.tap(\n PLUGIN_NAME,\n (source: string, chunk: Webpack.compilation.Chunk, hash: string) => {\n const extendedChunk: IExtendedChunk = chunk as IExtendedChunk;\n const assetOrChunkFound: boolean =\n !!this.options.skipDetection || this._detectAssetsOrChunks(extendedChunk);\n if (assetOrChunkFound) {\n return this._getStartupCode({\n source,\n chunk: extendedChunk,\n hash,\n requireFn: mainTemplate.requireFn\n });\n } else {\n return source;\n }\n }\n );\n } else {\n // Webpack 5 has its own automatic public path code, so only apply for Webpack 4\n const Webpack5Error: typeof Webpack5.WebpackError = (compiler as unknown as Webpack5.Compiler)\n .webpack.WebpackError;\n const thisPackageJson: IPackageJson = PackageJsonLookup.loadOwnPackageJson(__dirname);\n compilation.errors.push(\n new Webpack5Error(\n 'Webpack 5 supports its own automatic public path detection, ' +\n `so ${thisPackageJson.name} is unnecessary. Remove the ${SetPublicPathPlugin.name} plugin ` +\n 'from the Webpack configuration.'\n )\n );\n }\n }\n );\n\n // Webpack 5 has its own automatic public path code, so only apply for Webpack 4\n if (isWebpack4) {\n compiler.hooks.emit.tap(\n PLUGIN_NAME,\n (compilation: Webpack.compilation.Compilation | Webpack5.Compilation) => {\n for (const chunkGroup of compilation.chunkGroups) {\n for (const chunk of chunkGroup.chunks) {\n if (chunk[SHOULD_REPLACE_ASSET_NAME_TOKEN]) {\n for (const assetFilename of chunk.files) {\n let escapedAssetFilename: string;\n if (assetFilename.match(/\\.map$/)) {\n // Trim the \".map\" extension\n escapedAssetFilename = assetFilename.substr(\n 0,\n assetFilename.length - 4 /* '.map'.length */\n );\n escapedAssetFilename = Text.escapeRegExp(escapedAssetFilename);\n // source in sourcemaps is JSON-encoded\n escapedAssetFilename = JSON.stringify(escapedAssetFilename);\n // Trim the quotes from the JSON encoding\n escapedAssetFilename = escapedAssetFilename.substring(1, escapedAssetFilename.length - 1);\n } else {\n escapedAssetFilename = Text.escapeRegExp(assetFilename);\n }\n\n const asset: IAsset = compilation.assets[assetFilename];\n const originalAssetSource: string = asset.source();\n const originalAssetSize: number = asset.size();\n\n const newAssetSource: string = originalAssetSource.replace(\n ASSET_NAME_TOKEN_REGEX,\n escapedAssetFilename\n );\n const sizeDifference: number = assetFilename.length - ASSET_NAME_TOKEN.length;\n asset.source = () => newAssetSource;\n asset.size = () => originalAssetSize + sizeDifference;\n }\n }\n }\n }\n }\n );\n }\n }\n\n private _detectAssetsOrChunks(chunk: IExtendedChunk): boolean {\n for (const chunkGroup of chunk.groupsIterable) {\n if (chunkGroup.childrenIterable.size > 0) {\n return true;\n }\n }\n\n for (const innerModule of chunk.modulesIterable) {\n if (innerModule.buildInfo.assets && Object.keys(innerModule.buildInfo.assets).length > 0) {\n return true;\n }\n }\n\n return false;\n }\n\n private _getStartupCode(options: IStartupCodeOptions): string {\n const moduleOptions: IInternalOptions = { ...this.options };\n\n // If this module has ownership over any chunks or assets, inject the public path code\n moduleOptions.webpackPublicPathVariable = `${options.requireFn}.p`;\n moduleOptions.linePrefix = ' ';\n\n if (this.options.scriptName) {\n if (this.options.scriptName.name) {\n moduleOptions.regexName = this.options.scriptName.name;\n if (this.options.scriptName.isTokenized) {\n moduleOptions.regexName = moduleOptions.regexName\n .replace(/\\[name\\]/g, Text.escapeRegExp(options.chunk.name))\n .replace(/\\[hash\\]/g, options.chunk.renderedHash || '');\n }\n } else if (this.options.scriptName.useAssetName) {\n options.chunk[SHOULD_REPLACE_ASSET_NAME_TOKEN] = true;\n\n moduleOptions.regexName = ASSET_NAME_TOKEN;\n }\n }\n\n return [\n '// Set the webpack public path',\n '(function () {',\n getSetPublicPathCode(moduleOptions, console.error),\n '})();',\n '',\n options.source\n ].join(EOL);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SetPublicPathPlugin.js","sourceRoot":"","sources":["../src/SetPublicPathPlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,2BAAyB;AACzB,kFAAuE;AACvE,oEAA0F;AAO1F,mDAA8E;AAkG9E,MAAM,+BAA+B,GAAkB,MAAM,CAC3D,kDAAkD,CACnD,CAAC;AAaF,MAAM,WAAW,GAAW,yBAAyB,CAAC;AAEtD,MAAM,gBAAgB,GAAW,kDAAkD,CAAC;AAEpF,MAAM,sBAAsB,GAAW,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,MAAa,mBAAmB;IAG9B,YAAmB,OAA2C;QAC5D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,IAAI,OAAO,CAAC,UAAU,CAAC,YAAY,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE;gBAC9D,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;aAC3F;iBAAM,IAAI,OAAO,CAAC,UAAU,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,UAAU,CA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G,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;gBACvD,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE;oBACvC,aAAa,CAAC,SAAS,GAAG,aAAa,CAAC,SAAS;yBAC9C,OAAO,CAAC,WAAW,EAAE,wBAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;yBAC3D,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;iBAC3D;aACF;iBAAM,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;gBAC/C,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,GAAG,IAAI,CAAC;gBAEtD,aAAa,CAAC,SAAS,GAAG,gBAAgB,CAAC;aAC5C;SACF;QAED,OAAO;YACL,gCAAgC;YAChC,gBAAgB;YAChB,sCAAsC;YACtC,IAAA,oCAAoB,EAAC,aAAa,EAAE,OAAO,CAAC,KAAK,CAAC;YAClD,OAAO;YACP,EAAE;YACF,OAAO,CAAC,MAAM;SACf,CAAC,IAAI,CAAC,QAAG,CAAC,CAAC;IACd,CAAC;CACF;AA/JD,kDA+JC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { EOL } from 'os';\nimport { VersionDetection } from '@rushstack/webpack-plugin-utilities';\nimport { Text, PackageJsonLookup, type IPackageJson } from '@rushstack/node-core-library';\n\nimport type * as Webpack from 'webpack';\nimport type * as Tapable from 'tapable';\n// Workaround for https://github.com/pnpm/pnpm/issues/4301\nimport type * as Webpack5 from '@rushstack/heft-webpack5-plugin/node_modules/webpack';\n\nimport { type IInternalOptions, getSetPublicPathCode } from './codeGenerator';\n\n/**\n * The base options for setting the webpack public path at runtime.\n *\n * @public\n */\nexport interface ISetWebpackPublicPathOptions {\n /**\n * Use the System.baseURL property if it is defined.\n */\n systemJs?: boolean;\n\n /**\n * Use the specified string as a URL prefix after the SystemJS path or the publicPath option.\n * If neither systemJs nor publicPath is defined, this option will not apply and an exception will be thrown.\n */\n urlPrefix?: string;\n\n /**\n * Use the specified path as the base public path.\n */\n publicPath?: string;\n\n /**\n * Check for a variable with this name on the page and use its value as a regular expression against script paths to\n * the bundle's script. If a value foo is passed into regexVariable, the produced bundle will look for a variable\n * called foo during initialization, and if a foo variable is found, use its value as a regular expression to detect\n * the bundle's script.\n *\n * See the README for more information.\n */\n regexVariable?: string;\n\n /**\n * A function that returns a snippet of code that manipulates the variable with the name that's specified in the\n * parameter. If this parameter isn't provided, no post-processing code is included. The variable must be modified\n * in-place - the processed value should not be returned.\n *\n * See the README for more information.\n */\n getPostProcessScript?: (varName: string) => string;\n\n /**\n * If true, find the last script matching the regexVariable (if it is set). If false, find the first matching script.\n * This can be useful if there are multiple scripts loaded in the DOM that match the regexVariable.\n */\n preferLastFoundScript?: boolean;\n\n /**\n * If true, always include the public path-setting code. Don't try to detect if any chunks or assets are present.\n */\n skipDetection?: boolean;\n}\n\n/**\n * Options for the set-webpack-public-path plugin.\n *\n * @public\n */\nexport interface ISetWebpackPublicPathPluginOptions extends ISetWebpackPublicPathOptions {\n /**\n * An object that describes how the public path should be discovered.\n */\n scriptName?: {\n /**\n * If set to true, use the webpack generated asset's name. This option is not compatible with\n * andy other scriptName options.\n */\n useAssetName?: boolean;\n\n /**\n * A regular expression expressed as a string to be applied to all script paths on the page.\n */\n name?: string;\n\n /**\n * If true, the name property is tokenized.\n *\n * See the README for more information.\n */\n isTokenized?: boolean;\n };\n}\n\ninterface IAsset {\n size(): number;\n source(): string;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ndeclare const __dummyWebpack4MainTemplate: Webpack.compilation.MainTemplate;\ninterface IWebpack4ExtendedMainTemplate extends Webpack.compilation.MainTemplate {\n hooks: {\n startup: Tapable.SyncHook<string, Webpack.compilation.Chunk, string>;\n } & typeof __dummyWebpack4MainTemplate.hooks;\n}\n\nconst SHOULD_REPLACE_ASSET_NAME_TOKEN: unique symbol = Symbol(\n 'set-public-path-plugin-should-replace-asset-name'\n);\n\ninterface IExtendedChunk extends Webpack.compilation.Chunk {\n [SHOULD_REPLACE_ASSET_NAME_TOKEN]: boolean;\n}\n\ninterface IStartupCodeOptions {\n source: string;\n chunk: IExtendedChunk;\n hash: string;\n requireFn: string;\n}\n\nconst PLUGIN_NAME: string = 'set-webpack-public-path';\n\nconst ASSET_NAME_TOKEN: string = '-ASSET-NAME-c0ef4f86-b570-44d3-b210-4428c5b7825c';\n\nconst ASSET_NAME_TOKEN_REGEX: RegExp = new RegExp(ASSET_NAME_TOKEN);\n\n/**\n * This simple plugin sets the __webpack_public_path__ variable to a value specified in the arguments,\n * optionally appended to the SystemJs baseURL property.\n *\n * @public\n */\nexport class SetPublicPathPlugin implements Webpack.Plugin {\n public options: ISetWebpackPublicPathPluginOptions;\n\n public constructor(options: ISetWebpackPublicPathPluginOptions) {\n this.options = options;\n\n if (options.scriptName) {\n if (options.scriptName.useAssetName && options.scriptName.name) {\n throw new Error('scriptName.userAssetName and scriptName.name must not be used together');\n } else if (options.scriptName.isTokenized && !options.scriptName.name) {\n throw new Error('scriptName.isTokenized is only valid if scriptName.name is set');\n }\n }\n }\n\n public apply(compiler: Webpack.Compiler): void {\n // Casting here because VersionDetection refers to webpack 5 typings\n if (VersionDetection.isWebpack3OrEarlier(compiler as unknown as Webpack5.Compiler)) {\n throw new Error(`The ${SetPublicPathPlugin.name} plugin requires Webpack 4`);\n }\n\n // Casting here because VersionDetection refers to webpack 5 typings\n const isWebpack4: boolean = VersionDetection.isWebpack4(compiler as unknown as Webpack5.Compiler);\n\n compiler.hooks.compilation.tap(\n PLUGIN_NAME,\n (compilation: Webpack.compilation.Compilation | Webpack5.Compilation) => {\n if (isWebpack4) {\n const webpack4Compilation: Webpack.compilation.Compilation =\n compilation as Webpack.compilation.Compilation;\n const mainTemplate: IWebpack4ExtendedMainTemplate =\n webpack4Compilation.mainTemplate as IWebpack4ExtendedMainTemplate;\n mainTemplate.hooks.startup.tap(\n PLUGIN_NAME,\n (source: string, chunk: Webpack.compilation.Chunk, hash: string) => {\n const extendedChunk: IExtendedChunk = chunk as IExtendedChunk;\n const assetOrChunkFound: boolean =\n !!this.options.skipDetection || this._detectAssetsOrChunks(extendedChunk);\n if (assetOrChunkFound) {\n return this._getStartupCode({\n source,\n chunk: extendedChunk,\n hash,\n requireFn: mainTemplate.requireFn\n });\n } else {\n return source;\n }\n }\n );\n } else {\n // Webpack 5 has its own automatic public path code, so only apply for Webpack 4\n const Webpack5Error: typeof Webpack5.WebpackError = (compiler as unknown as Webpack5.Compiler)\n .webpack.WebpackError;\n const thisPackageJson: IPackageJson = PackageJsonLookup.loadOwnPackageJson(__dirname);\n compilation.errors.push(\n new Webpack5Error(\n 'Webpack 5 supports its own automatic public path detection, ' +\n `so ${thisPackageJson.name} is unnecessary. Remove the ${SetPublicPathPlugin.name} plugin ` +\n 'from the Webpack configuration.'\n )\n );\n }\n }\n );\n\n // Webpack 5 has its own automatic public path code, so only apply for Webpack 4\n if (isWebpack4) {\n compiler.hooks.emit.tap(\n PLUGIN_NAME,\n (compilation: Webpack.compilation.Compilation | Webpack5.Compilation) => {\n for (const chunkGroup of compilation.chunkGroups) {\n for (const chunk of chunkGroup.chunks) {\n if (chunk[SHOULD_REPLACE_ASSET_NAME_TOKEN]) {\n for (const assetFilename of chunk.files) {\n let escapedAssetFilename: string;\n if (assetFilename.match(/\\.map$/)) {\n // Trim the \".map\" extension\n escapedAssetFilename = assetFilename.substr(\n 0,\n assetFilename.length - 4 /* '.map'.length */\n );\n escapedAssetFilename = Text.escapeRegExp(escapedAssetFilename);\n // source in sourcemaps is JSON-encoded\n escapedAssetFilename = JSON.stringify(escapedAssetFilename);\n // Trim the quotes from the JSON encoding\n escapedAssetFilename = escapedAssetFilename.substring(1, escapedAssetFilename.length - 1);\n } else {\n escapedAssetFilename = Text.escapeRegExp(assetFilename);\n }\n\n const asset: IAsset = compilation.assets[assetFilename];\n const originalAssetSource: string = asset.source();\n const originalAssetSize: number = asset.size();\n\n const newAssetSource: string = originalAssetSource.replace(\n ASSET_NAME_TOKEN_REGEX,\n escapedAssetFilename\n );\n const sizeDifference: number = assetFilename.length - ASSET_NAME_TOKEN.length;\n asset.source = () => newAssetSource;\n asset.size = () => originalAssetSize + sizeDifference;\n }\n }\n }\n }\n }\n );\n }\n }\n\n private _detectAssetsOrChunks(chunk: IExtendedChunk): boolean {\n for (const chunkGroup of chunk.groupsIterable) {\n if (chunkGroup.childrenIterable.size > 0) {\n return true;\n }\n }\n\n for (const innerModule of chunk.modulesIterable) {\n if (innerModule.buildInfo.assets && Object.keys(innerModule.buildInfo.assets).length > 0) {\n return true;\n }\n }\n\n return false;\n }\n\n private _getStartupCode(options: IStartupCodeOptions): string {\n const moduleOptions: IInternalOptions = { ...this.options };\n\n // If this module has ownership over any chunks or assets, inject the public path code\n moduleOptions.webpackPublicPathVariable = `${options.requireFn}.p`;\n moduleOptions.linePrefix = ' ';\n\n if (this.options.scriptName) {\n if (this.options.scriptName.name) {\n moduleOptions.regexName = this.options.scriptName.name;\n if (this.options.scriptName.isTokenized) {\n moduleOptions.regexName = moduleOptions.regexName\n .replace(/\\[name\\]/g, Text.escapeRegExp(options.chunk.name))\n .replace(/\\[hash\\]/g, options.chunk.renderedHash || '');\n }\n } else if (this.options.scriptName.useAssetName) {\n options.chunk[SHOULD_REPLACE_ASSET_NAME_TOKEN] = true;\n\n moduleOptions.regexName = ASSET_NAME_TOKEN;\n }\n }\n\n return [\n '// Set the webpack public path',\n '(function () {',\n // eslint-disable-next-line no-console\n getSetPublicPathCode(moduleOptions, console.error),\n '})();',\n '',\n options.source\n ].join(EOL);\n }\n}\n"]}
|
package/lib/codeGenerator.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeGenerator.d.ts","sourceRoot":"","sources":["../src/codeGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"codeGenerator.d.ts","sourceRoot":"","sources":["../src/codeGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAA2D,CAAC;AAE/F,MAAM,WAAW,gBAAiB,SAAQ,4BAA4B;IACpE,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAiCD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EACzB,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACrC,MAAM,CA+ER;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,OAAe,GAAG,MAAM,CAepE"}
|
package/lib/codeGenerator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeGenerator.js","sourceRoot":"","sources":["../src/codeGenerator.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D;;GAEG;AACU,QAAA,oBAAoB,GAAW,kDAAkD,CAAC;AAQ/F,MAAM,OAAO,GAAW,YAAY,CAAC;AAErC,SAAS,SAAS,CAAC,KAAe,EAAE,UAAmB;IACrD,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE;QACpB,IAAI,IAAI,EAAE;YACR,OAAO,GAAG,UAAU,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;SACrC;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC;SACV,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,kBAAk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AAoB,EAAE;YAChC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,OAAO,KAAK,EAAE,KAAK,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;SAC9F;KACF;IAED,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,yBAAyB,MAAM,OAAO,GAAG,CAAC,CAAC;IAEjE,OAAO,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;AAC9C,CAAC;AAlFD,oDAkFC;AAED;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CAAC,QAAiB,KAAK;IAC1D,iCAAiC;IACjC,eAAe;IACf,8GAA8G;IAC9G,yDAAyD;IACzD,mCAAmC;IACnC,+CAA+C;IAC/C,iCAAiC;IACjC,iDAAiD;IACjD,6EAA6E;IAC7E,MAAM;IACN,IAAI;IACJ,OAAO;IAEP,OAAO,iBAAiB,4BAAoB,MAAM,4BAAoB,4IAA4I,4BAAoB,cAAc,CAAC;AACvP,CAAC;AAfD,sDAeC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { ISetWebpackPublicPathOptions } from './SetPublicPathPlugin';\n\n/**\n * @public\n */\nexport const registryVariableName: string = 'window.__setWebpackPublicPathLoaderSrcRegistry__';\n\nexport interface IInternalOptions extends ISetWebpackPublicPathOptions {\n webpackPublicPathVariable?: string;\n regexName?: string;\n linePrefix?: string;\n}\n\nconst varName: string = 'publicPath';\n\nfunction joinLines(lines: string[], linePrefix?: string): string {\n return lines\n .map((line: string) => {\n if (line) {\n return `${linePrefix || ''}${line}`;\n } else {\n return line;\n }\n })\n .join('\\n')\n .replace(/\\n\\n+/g, '\\n\\n');\n}\n\nfunction escapeSingleQuotes(str: string): string | undefined {\n if (str) {\n return str.replace(\"'\", \"\\\\'\");\n } else {\n return undefined;\n }\n}\n\nfunction appendSlashAndEscapeSingleQuotes(str: string): string | undefined {\n if (str && str.substr(-1) !== '/') {\n str = str + '/';\n }\n\n return escapeSingleQuotes(str);\n}\n\nexport function getSetPublicPathCode(\n options: IInternalOptions,\n emitWarning: (warning: string) => void\n): string {\n if (!options.webpackPublicPathVariable) {\n throw new Error('\"webpackPublicPathVariable\" option must be defined.');\n }\n\n let lines: string[] = [];\n if (options.regexName) {\n lines = [`var scripts = document.getElementsByTagName('script');`];\n\n const regexInitializationSnippet: string = `/${options.regexName}/i`;\n const regexVarName: string | undefined = options.regexVariable;\n if (options.regexVariable) {\n lines.push(\n ...[\n `var regex = (typeof ${regexVarName} !== 'undefined') ? ${regexVarName} : ${regexInitializationSnippet};`\n ]\n );\n } else {\n lines.push(...[`var regex = ${regexInitializationSnippet};`]);\n }\n\n lines.push(\n ...[\n `var ${varName};`,\n '',\n 'if (scripts && scripts.length) {',\n ' for (var i = 0; i < scripts.length; i++) {',\n ' if (!scripts[i]) continue;',\n ` var path = scripts[i].getAttribute('src');`,\n ' if (path && path.match(regex)) {',\n ` ${varName} = path.substring(0, path.lastIndexOf('/') + 1);`,\n ...(options.preferLastFoundScript ? [] : [' break;']),\n ' }',\n ' }',\n '}',\n '',\n `if (!${varName}) {`,\n ` for (var global in ${registryVariableName}) {`,\n ' if (global && global.match(regex)) {',\n ` ${varName} = global.substring(0, global.lastIndexOf('/') + 1);`,\n ...(options.preferLastFoundScript ? [] : [' break;']),\n ' }',\n ' }',\n '}'\n ]\n );\n\n if (options.getPostProcessScript) {\n lines.push(...['', `if (${varName}) {`, ` ${options.getPostProcessScript(varName)};`, '}', '']);\n }\n } else {\n if (options.publicPath) {\n lines.push(...[`var ${varName} = '${appendSlashAndEscapeSingleQuotes(options.publicPath)}';`, '']);\n } else if (options.systemJs) {\n lines.push(\n ...[\n `var ${varName} = window.System ? window.System.baseURL || '' : '';`,\n `if (${varName} !== '' && ${varName}.substr(-1) !== '/') ${varName} += '/';`,\n ''\n ]\n );\n } else {\n emitWarning(`Neither 'publicPath' nor 'systemJs' is defined, so the public path will not be modified`);\n\n return '';\n }\n\n if (options.urlPrefix && options.urlPrefix !== '') {\n lines.push(...[`${varName} += '${appendSlashAndEscapeSingleQuotes(options.urlPrefix)}';`, '']);\n }\n\n if (options.getPostProcessScript) {\n lines.push(...[`if (${varName}) {`, ` ${options.getPostProcessScript(varName)};`, '}', '']);\n }\n }\n\n lines.push(`${options.webpackPublicPathVariable} = ${varName};`);\n\n return joinLines(lines, options.linePrefix);\n}\n\n/**\n * /**\n * This function returns a block of JavaScript that maintains a global register of script tags.\n *\n * @param debug - If true, the code returned code is not minified. Defaults to false.\n *\n * @public\n */\nexport function getGlobalRegisterCode(debug: boolean = false): string {\n // Minified version of this code:\n // (function(){\n // if (!window.__setWebpackPublicPathLoaderSrcRegistry__) window.__setWebpackPublicPathLoaderSrcRegistry__={};\n // var scripts = document.getElementsByTagName('script');\n // if (scripts && scripts.length) {\n // for (var i = 0; i < scripts.length; i++) {\n // if (!scripts[i]) continue;\n // var path = scripts[i].getAttribute('src');\n // if (path) window.__setWebpackPublicPathLoaderSrcRegistry__[path]=true;\n // }\n // }\n // })()\n\n return `\\n!function(){${registryVariableName}||(${registryVariableName}={});var e=document.getElementsByTagName(\"script\");if(e&&e.length)for(var t=0;t<e.length;t++)if(e[t]){var r=e[t].getAttribute(\"src\");r&&(${registryVariableName}[r]=!0)}}();`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"codeGenerator.js","sourceRoot":"","sources":["../src/codeGenerator.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D;;GAEG;AACU,QAAA,oBAAoB,GAAW,kDAAkD,CAAC;AAQ/F,MAAM,OAAO,GAAW,YAAY,CAAC;AAErC,SAAS,SAAS,CAAC,KAAe,EAAE,UAAmB;IACrD,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE;QACpB,IAAI,IAAI,EAAE;YACR,OAAO,GAAG,UAAU,IAAI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AC,SAAS,KAAK,EAAE,EAAE;YACjD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,QAAQ,gCAAgC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;SAChG;QAED,IAAI,OAAO,CAAC,oBAAoB,EAAE;YAChC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,OAAO,KAAK,EAAE,KAAK,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;SAC9F;KACF;IAED,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,yBAAyB,MAAM,OAAO,GAAG,CAAC,CAAC;IAEjE,OAAO,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;AAC9C,CAAC;AAlFD,oDAkFC;AAED;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CAAC,QAAiB,KAAK;IAC1D,iCAAiC;IACjC,eAAe;IACf,8GAA8G;IAC9G,yDAAyD;IACzD,mCAAmC;IACnC,+CAA+C;IAC/C,iCAAiC;IACjC,iDAAiD;IACjD,6EAA6E;IAC7E,MAAM;IACN,IAAI;IACJ,OAAO;IAEP,OAAO,iBAAiB,4BAAoB,MAAM,4BAAoB,4IAA4I,4BAAoB,cAAc,CAAC;AACvP,CAAC;AAfD,sDAeC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { ISetWebpackPublicPathOptions } from './SetPublicPathPlugin';\n\n/**\n * @public\n */\nexport const registryVariableName: string = 'window.__setWebpackPublicPathLoaderSrcRegistry__';\n\nexport interface IInternalOptions extends ISetWebpackPublicPathOptions {\n webpackPublicPathVariable?: string;\n regexName?: string;\n linePrefix?: string;\n}\n\nconst varName: string = 'publicPath';\n\nfunction joinLines(lines: string[], linePrefix?: string): string {\n return lines\n .map((line: string) => {\n if (line) {\n return `${linePrefix || ''}${line}`;\n } else {\n return line;\n }\n })\n .join('\\n')\n .replace(/\\n\\n+/g, '\\n\\n');\n}\n\nfunction escapeSingleQuotes(str: string): string | undefined {\n if (str) {\n return str.replace(\"'\", \"\\\\'\");\n } else {\n return undefined;\n }\n}\n\nfunction appendSlashAndEscapeSingleQuotes(str: string): string | undefined {\n if (str && str.substr(-1) !== '/') {\n str = str + '/';\n }\n\n return escapeSingleQuotes(str);\n}\n\nexport function getSetPublicPathCode(\n options: IInternalOptions,\n emitWarning: (warning: string) => void\n): string {\n if (!options.webpackPublicPathVariable) {\n throw new Error('\"webpackPublicPathVariable\" option must be defined.');\n }\n\n let lines: string[] = [];\n if (options.regexName) {\n lines = [`var scripts = document.getElementsByTagName('script');`];\n\n const regexInitializationSnippet: string = `/${options.regexName}/i`;\n const regexVarName: string | undefined = options.regexVariable;\n if (options.regexVariable) {\n lines.push(\n ...[\n `var regex = (typeof ${regexVarName} !== 'undefined') ? ${regexVarName} : ${regexInitializationSnippet};`\n ]\n );\n } else {\n lines.push(...[`var regex = ${regexInitializationSnippet};`]);\n }\n\n lines.push(\n ...[\n `var ${varName};`,\n '',\n 'if (scripts && scripts.length) {',\n ' for (var i = 0; i < scripts.length; i++) {',\n ' if (!scripts[i]) continue;',\n ` var path = scripts[i].getAttribute('src');`,\n ' if (path && path.match(regex)) {',\n ` ${varName} = path.substring(0, path.lastIndexOf('/') + 1);`,\n ...(options.preferLastFoundScript ? [] : [' break;']),\n ' }',\n ' }',\n '}',\n '',\n `if (!${varName}) {`,\n ` for (var global in ${registryVariableName}) {`,\n ' if (global && global.match(regex)) {',\n ` ${varName} = global.substring(0, global.lastIndexOf('/') + 1);`,\n ...(options.preferLastFoundScript ? [] : [' break;']),\n ' }',\n ' }',\n '}'\n ]\n );\n\n if (options.getPostProcessScript) {\n lines.push(...['', `if (${varName}) {`, ` ${options.getPostProcessScript(varName)};`, '}', '']);\n }\n } else {\n if (options.publicPath) {\n lines.push(...[`var ${varName} = '${appendSlashAndEscapeSingleQuotes(options.publicPath)}';`, '']);\n } else if (options.systemJs) {\n lines.push(\n ...[\n `var ${varName} = window.System ? window.System.baseURL || '' : '';`,\n `if (${varName} !== '' && ${varName}.substr(-1) !== '/') ${varName} += '/';`,\n ''\n ]\n );\n } else {\n emitWarning(`Neither 'publicPath' nor 'systemJs' is defined, so the public path will not be modified`);\n\n return '';\n }\n\n if (options.urlPrefix && options.urlPrefix !== '') {\n lines.push(...[`${varName} += '${appendSlashAndEscapeSingleQuotes(options.urlPrefix)}';`, '']);\n }\n\n if (options.getPostProcessScript) {\n lines.push(...[`if (${varName}) {`, ` ${options.getPostProcessScript(varName)};`, '}', '']);\n }\n }\n\n lines.push(`${options.webpackPublicPathVariable} = ${varName};`);\n\n return joinLines(lines, options.linePrefix);\n}\n\n/**\n * /**\n * This function returns a block of JavaScript that maintains a global register of script tags.\n *\n * @param debug - If true, the code returned code is not minified. Defaults to false.\n *\n * @public\n */\nexport function getGlobalRegisterCode(debug: boolean = false): string {\n // Minified version of this code:\n // (function(){\n // if (!window.__setWebpackPublicPathLoaderSrcRegistry__) window.__setWebpackPublicPathLoaderSrcRegistry__={};\n // var scripts = document.getElementsByTagName('script');\n // if (scripts && scripts.length) {\n // for (var i = 0; i < scripts.length; i++) {\n // if (!scripts[i]) continue;\n // var path = scripts[i].getAttribute('src');\n // if (path) window.__setWebpackPublicPathLoaderSrcRegistry__[path]=true;\n // }\n // }\n // })()\n\n return `\\n!function(){${registryVariableName}||(${registryVariableName}={});var e=document.getElementsByTagName(\"script\");if(e&&e.length)for(var t=0;t<e.length;t++)if(e[t]){var r=e[t].getAttribute(\"src\");r&&(${registryVariableName}[r]=!0)}}();`;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/set-webpack-public-path-plugin",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "This plugin sets the webpack public path at runtime.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "dist/set-webpack-public-path-plugin.d.ts",
|
|
@@ -19,16 +19,15 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@rushstack/node-core-library": "3.60.
|
|
23
|
-
"@rushstack/webpack-plugin-utilities": "0.3.
|
|
22
|
+
"@rushstack/node-core-library": "3.60.1",
|
|
23
|
+
"@rushstack/webpack-plugin-utilities": "0.3.4"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/tapable": "1.0.6",
|
|
27
27
|
"@types/webpack": "4.41.32",
|
|
28
|
-
"@rushstack/
|
|
29
|
-
"@rushstack/heft": "0.61.1",
|
|
28
|
+
"@rushstack/heft": "0.61.2",
|
|
30
29
|
"local-node-rig": "1.0.0",
|
|
31
|
-
"@rushstack/heft-webpack5-plugin": "0.9.
|
|
30
|
+
"@rushstack/heft-webpack5-plugin": "0.9.4"
|
|
32
31
|
},
|
|
33
32
|
"scripts": {
|
|
34
33
|
"build": "heft build --clean",
|