astro/scripts/index.js
Matthew Phillips fc52321a88
Consolidate hydration scripts into just one (#3571)
* Remove redundant hydration scripts

* Prebuild the island JS

* Fix build

* Updates to tests

* Update more references

* Custom element test now has two classic scripts

* Account for non-default exports

* Restructure hydration directives

* Move nested logic into the island component

* Remove try/catch
2022-06-15 08:50:05 -04:00

24 lines
551 B
JavaScript
Executable file

#!/usr/bin/env node
export default async function run() {
const [cmd, ...args] = process.argv.slice(2);
switch (cmd) {
case 'dev':
case 'build': {
const { default: build } = await import('./cmd/build.js');
await build(...args, cmd === 'dev' ? 'IS_DEV' : undefined);
break;
}
case 'copy': {
const { default: copy } = await import('./cmd/copy.js');
await copy(...args);
break;
}
case 'prebuild': {
const { default: prebuild } = await import('./cmd/prebuild.js');
await prebuild(...args);
break;
}
}
}
run();