Skip to content

Commit 71d4926

Browse files
committed
Add build script
1 parent b43b3a9 commit 71d4926

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

build.mjs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env zx
2+
3+
await $`npm run lint && npx svelte-package -o package && npx vite build -c vite.dist.config.js`
4+
const pkg = await fs.readJson('package.json')
5+
pkg.scripts = undefined
6+
await fs.writeJson('package/package.json', pkg, { spaces: 2 })
7+
await fs.copy('README.md', 'package/README.md')
8+
await fs.copy('LICENSE', 'package/LICENSE')
9+
await fs.copy('package/dist/index.umd.js', 'package/dist/index.umd.cjs')
10+
await $`cd package && npx publint`
11+
12+
echo`
13+
To publish to npm, run:
14+
$ cd package && npm publish --access public
15+
`

0 commit comments

Comments
 (0)