Skip to content

Commit

Permalink
feat: treat systemjs build as standalone one
Browse files Browse the repository at this point in the history
  • Loading branch information
streamside committed Sep 7, 2022
1 parent 0724130 commit 2f1b42c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions commands/build/lib/build.js
Expand Up @@ -205,18 +205,17 @@ const esm = async (argv, core) => {
},
});
if (!c) {
return Promise.resolve();
return undefined;
}
const bundle = await rollup.rollup(c.input);
return bundle.write(c.output);
};

const systemjs = async (argv, core) => {
const systemjs = async (argv) => {
const c = config({
mode: argv.mode || 'production',
format: 'systemjs',
argv,
core,
behaviours: {
getExternal: ({ config: cfg }) => {
const defaultExternal = ['@nebula.js/stardust', 'picasso.js', 'picasso-plugin-q', 'react', 'react-dom'];
Expand All @@ -229,7 +228,7 @@ const systemjs = async (argv, core) => {
},
});
if (!c) {
return Promise.resolve();
return undefined;
}
const bundle = await rollup.rollup(c.input);
return bundle.write(c.output);
Expand Down Expand Up @@ -319,15 +318,13 @@ async function build(argv = {}) {
return watch(buildConfig);
}

// Standalone
await umd(buildConfig);
await esm(buildConfig);
await systemjs(buildConfig);

// Core
if (argv.core) {
const core = path.resolve(process.cwd(), argv.core);
await esm(buildConfig, core);
await systemjs(buildConfig, core);
}

return undefined;
Expand Down

0 comments on commit 2f1b42c

Please sign in to comment.