We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
膜拜大佬,求解惑。看了下面这段源码,发现把hash去掉了,导致chunk-xxx.js只会加载一个。这里冒昧的问下,为何要result[ext ? ${name}.${ext} : name] = assetsTag;。文件名相同hash后缀不同的不加载,这样会导致有些js不会加载 parseManifestFromHTML(html: string): Record<string, AssetsTagItem> { const result: Record<string, AssetsTagItem> = {}; const matchResult = html.match(STYLE_LINK_OR_SCRIPT_REG); matchResult.forEach(item => { const linkOrSrcResult = item.match(LINK_OR_SRC_REG); if (linkOrSrcResult && linkOrSrcResult[2]) { const src = linkOrSrcResult[2]; const hashName = getResourceFileName(src); let barSplitIndex = hashName.indexOf('-'); let dotSplitIndex = hashName.indexOf('.'); const splitIndex = barSplitIndex > -1 ? barSplitIndex : dotSplitIndex; if (splitIndex > -1) { const name = hashName.slice(0, splitIndex); const ext = getExtName(hashName); const assetsTag: AssetsTagItem = { src: src }; result[ext ?${name}.${ext}` : name] = assetsTag;
${name}.${ext}
parseManifestFromHTML(html: string): Record<string, AssetsTagItem> { const result: Record<string, AssetsTagItem> = {}; const matchResult = html.match(STYLE_LINK_OR_SCRIPT_REG); matchResult.forEach(item => { const linkOrSrcResult = item.match(LINK_OR_SRC_REG); if (linkOrSrcResult && linkOrSrcResult[2]) { const src = linkOrSrcResult[2]; const hashName = getResourceFileName(src); let barSplitIndex = hashName.indexOf('-'); let dotSplitIndex = hashName.indexOf('.'); const splitIndex = barSplitIndex > -1 ? barSplitIndex : dotSplitIndex; if (splitIndex > -1) { const name = hashName.slice(0, splitIndex); const ext = getExtName(hashName); const assetsTag: AssetsTagItem = { src: src }; result[ext ?
const attributes = this.parseTagAttributes(item); if (attributes) { assetsTag.attributes = attributes; } // const typeTagResult = item.match(TAG_TYPE_REG); // if (typeTagResult && typeTagResult[1]) { // assetsTag.attributes = { // type: typeTagResult[1] // }; // } } } }); return result; }`
The text was updated successfully, but these errors were encountered:
这里主要是由于加载哪些 scripts 是支持配置的,比如配置 ["main.js", "chunk.js"] 实际会通过这个名字找到对于的 hash 资源路径加载。
一般不会在 index.html 中输出多个 chunk-xxx.js 初始加载时一次性加载的,多个 chunk 都是延迟加载的,不知道你的具体场景是什么? 如果这个场景没有覆盖到,可以考虑如何支持一下
Sorry, something went wrong.
这里主要是由于加载哪些 scripts 是支持配置的,比如配置 ["main.js", "chunk.js"] 实际会通过这个名字找到对于的 hash 资源路径加载。 一般不会在 index.html 中输出多个 chunk-xxx.js 初始加载时一次性加载的,多个 chunk 都是延迟加载的,不知道你的具体场景是什么? 如果这个场景没有覆盖到,可以考虑如何支持一下
angular17采用@angular-builders/custom-esbuild:application进行打包时候发现:index.html中会加载多个chunk-xxx.js。新项目从qiankun改为拥抱ngx-planet了!
No branches or pull requests
膜拜大佬,求解惑。看了下面这段源码,发现把hash去掉了,导致chunk-xxx.js只会加载一个。这里冒昧的问下,为何要result[ext ?
${name}.${ext}
: name] = assetsTag;。文件名相同hash后缀不同的不加载,这样会导致有些js不会加载parseManifestFromHTML(html: string): Record<string, AssetsTagItem> { const result: Record<string, AssetsTagItem> = {}; const matchResult = html.match(STYLE_LINK_OR_SCRIPT_REG); matchResult.forEach(item => { const linkOrSrcResult = item.match(LINK_OR_SRC_REG); if (linkOrSrcResult && linkOrSrcResult[2]) { const src = linkOrSrcResult[2]; const hashName = getResourceFileName(src); let barSplitIndex = hashName.indexOf('-'); let dotSplitIndex = hashName.indexOf('.'); const splitIndex = barSplitIndex > -1 ? barSplitIndex : dotSplitIndex; if (splitIndex > -1) { const name = hashName.slice(0, splitIndex); const ext = getExtName(hashName); const assetsTag: AssetsTagItem = { src: src }; result[ext ?
${name}.${ext}` : name] = assetsTag;The text was updated successfully, but these errors were encountered: