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
webpack配置 publichPath: '//7.url.cn/edu/user/'
publichPath
插件配置
filename: (n) => `${n}/${n}`
Resource.js
// add a file to newNodes const outToNewNodes = (fileName, fileContent) => { // resource should load in URL relative to html output path let resourceRelative2HTMLPath = url.resolve(webpackOutputPublicPath, fileName); resourceRelative2HTMLPath = util.urlRelative(htmlOutputURL, resourceRelative2HTMLPath); resourceRelative2HTMLPath = url.resolve(webpackOutputPublicPath, resourceRelative2HTMLPath); if (type === 'script') { // output js file only ... } else if (type === 'style') { // output css file only ... } else if (type === 'other') { ... } };
此类情况当执行到上面Resource.js文件的outToNewNodes方法时,resourceRelative2HTMLPath最终计算出资源文件的路径为//7.url.cn/edu/[name],故html加载资源的路径出错。
//7.url.cn/edu/[name]
注释掉这两行代码后,跑通
// resourceRelative2HTMLPath = util.urlRelative(htmlOutputURL, resourceRelative2HTMLPath); // resourceRelative2HTMLPath = url.resolve(webpackOutputPublicPath, resourceRelative2HTMLPath);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
webpack配置
publichPath
: '//7.url.cn/edu/user/'插件配置
Resource.js
此类情况当执行到上面Resource.js文件的outToNewNodes方法时,resourceRelative2HTMLPath最终计算出资源文件的路径为
//7.url.cn/edu/[name]
,故html加载资源的路径出错。注释掉这两行代码后,跑通
The text was updated successfully, but these errors were encountered: