kopia lustrzana https://github.com/shoelace-style/shoelace
fix serve
rodzic
aadcb486a9
commit
73ad76a2fa
|
@ -125,7 +125,9 @@ async function buildTheSource() {
|
||||||
|
|
||||||
if (serve) {
|
if (serve) {
|
||||||
// Use the context API to allow incremental dev builds
|
// Use the context API to allow incremental dev builds
|
||||||
return await Promise.all([esbuild.context(cdnConfig), esbuild.context(npmConfig)]);
|
const contexts = await Promise.all([esbuild.context(cdnConfig), esbuild.context(npmConfig)]);
|
||||||
|
await Promise.all(contexts.map(context => context.rebuild()));
|
||||||
|
return contexts;
|
||||||
} else {
|
} else {
|
||||||
// Use the standard API for production builds
|
// Use the standard API for production builds
|
||||||
return await Promise.all([esbuild.build(cdnConfig), esbuild.build(npmConfig)]);
|
return await Promise.all([esbuild.build(cdnConfig), esbuild.build(npmConfig)]);
|
||||||
|
@ -208,13 +210,15 @@ await nextTask('Building source files', async () => {
|
||||||
buildResults = await buildTheSource();
|
buildResults = await buildTheSource();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Copy the CDN build to the docs
|
// Copy the CDN build to the docs (prod only; we use a virtual directory in dev)
|
||||||
await nextTask(`Copying the build to "${sitedir}"`, async () => {
|
if (!serve) {
|
||||||
await deleteAsync(sitedir);
|
await nextTask(`Copying the build to "${sitedir}"`, async () => {
|
||||||
|
await deleteAsync(sitedir);
|
||||||
|
|
||||||
// We copy the CDN build because that has everything bundled.
|
// We copy the CDN build because that has everything bundled.
|
||||||
await copy(cdndir, path.join(sitedir, 'cdn'));
|
await copy(cdndir, path.join(sitedir, 'cdn'));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Launch the dev server
|
// Launch the dev server
|
||||||
if (serve) {
|
if (serve) {
|
||||||
|
|
Ładowanie…
Reference in New Issue