As we tested and see, when we config our webpack to handle multiple entries, webpack will run both in parallel way.
But if we need first config output to use in second part what should we do?
If we have some config like this :
module.exports = [
{
mode: 'production',
entry: "./src/workbox-sw.ts",
output: {
filename: "workbox-sw.js",
path: __dirname + "/build"
},
}, {
entry: "./src/public/app.ts",
output: {
filename: "app.js",
path: __dirname + "/build/public"
},
target: "web",
plugins: [
new WorkboxPlugin.InjectManifest({
swSrc: __dirname + '/build/workbox-sw.js'),
swDest: 'sw.js',
exclude: [
/\.map$/,
/manifest$/,
/\.htaccess$/,
/service-worker\.js$/,
/sw\.js$/,
],
}),
],
}
]
is there a way to run first job then do second?
with some config like this, I got module not found error:
ERROR in Entry module not found: Error: Can't resolve '/project/build/workbox-sw.js' in '/project'