Skip to content

Commit

Permalink
Simplify build script
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodevx committed Feb 27, 2023
1 parent d2aba72 commit 323e0b6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions build-all.mjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
#!/usr/bin/env zx

const args = process.argv.slice(2)

await $`npm run lint`
await $`npm run check`
await $`npx svelte-package`
await $`npm run lint && npm run check && npx svelte-package`
const out = await $`npx vite build -c vite.dist.config.js`
await fs.copy('dist/dist/index.umd.js', 'dist/dist/index.umd.cjs')

// Prepare `/dist`
const pkg = await fs.readJson('package.json')
pkg.scripts = undefined
await fs.writeJson('dist/package.json', pkg, { spaces: 2 })
await fs.copy('README.md', 'dist/README.md')
await fs.copy('LICENSE', 'dist/LICENSE')
await fs.copy('dist/dist/index.umd.js', 'dist/dist/index.umd.cjs')
await $`cd dist && npx publint`

if (args.includes('--packageOnly')) process.exit()
if (argv.packageOnly) process.exit()

await $`npm run build`

Expand Down

0 comments on commit 323e0b6

Please sign in to comment.