Closed martin-liu closed 6 years ago
你可以修改一下 publicPath 为 /projectA/public/xxx 方式 不知道是否满足你的要求 @martin-liu
@hubcarl 这个不work
Error: ENOENT: no such file or directory, open '/var/folders/9y/pb986sqd16x39vrd7ggqcc88390xc6/T/easywebpack/mytest/dev/dll/file/public/js/vendor.js'
at Object.fs.openSync (fs.js:667:18)
at Object.fs.readFileSync (fs.js:572:33)
at opts.assets.forEach.chunk (/opt/code/mytest/node_modules/webpack-asset-file-plugin/lib/index.js:15:28)
at Array.forEach (<anonymous>)
at compiler.hooks.afterCompile.tap.compilation (/opt/code/mytest/node_modules/webpack-asset-file-plugin/lib/index.js:12:24)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/opt/code/mytest/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:9:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/opt/code/mytest/node_modules/tapable/lib/Hook.js:35:21)
at compilation.seal.err (/opt/code/mytest/node_modules/webpack/lib/Compiler.js:483:30)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/opt/code/mytest/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:9:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/opt/code/mytest/node_modules/tapable/lib/Hook.js:35:21)
@martin-liu npx easy clean 一把 看看
你可以修改一下 publicPath 为 /projectA/public/xxx 方式 不知道是否满足你的要求 @martin-liu
请问是哪边的publicPath
我发现页面render时inject到html里的css/js文件都是绝对路径, 比如
/public/xxx
.但有时候我们可能在一个domain下有多个项目,比如
xxx.com/projectA/
,这时我们在deploy时需要设置<base href="/projectA/" >
, 然后css/js的reference需要是相对路径。我看了下,当前的code是读
config/manifest.json
里的deps然后inject. 所以我现在是添加了下面的code到webpack.config.js
里来work around这个问题:不过,是不是能添加一个option来选择是否inject相对路径?