Skip to content

Commit

Permalink
fix: run mutiple output builds sequantially
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 5, 2021
1 parent ef100d0 commit ab80522
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 7 additions & 3 deletions packages/vite/src/node/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export function resolveBuildPlugins(
const options = config.build
return {
pre: [
...(options.rollupOptions.plugins || []),
commonjsPlugin({
include: [/node_modules/],
extensions: ['.js', '.cjs']
Expand All @@ -180,7 +179,8 @@ export function resolveBuildPlugins(
dynamicImportVars({
warnOnError: true,
exclude: [/node_modules/]
})
}),
...(options.rollupOptions.plugins || [])
],
post: [
buildEsbuildPlugin(config),
Expand Down Expand Up @@ -299,7 +299,11 @@ async function doBuild(
config.logger
)
if (Array.isArray(outputs)) {
return Promise.all(outputs.map(generate))
const res = []
for (const output of outputs) {
res.push(await generate(output))
}
return res
} else {
return generate(outputs)
}
Expand Down
2 changes: 0 additions & 2 deletions packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin {
)
}

// TODO should store the imported entries for each page
// and inject corresponding assets
processedHtml.set(id, s.toString())
return js
}
Expand Down

0 comments on commit ab80522

Please sign in to comment.