Skip to content

Commit

Permalink
fix: copy package & other meta files
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
  • Loading branch information
vinayakkulkarni committed Apr 11, 2023
1 parent 3207a3c commit b1baff2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build && npm run package",
"build": "vite build && npm run package && node scripts/copy.js",
"preview": "vite preview",
"package": "svelte-package",
"package:watch": "svelte-package --watch",
Expand Down
11 changes: 11 additions & 0 deletions scripts/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { readFileSync, writeFileSync } from 'node:fs';

// read file into JSON
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
const readme = readFileSync('README.md', 'utf-8');
const license = readFileSync('LICENSE', 'utf-8');

// write it to your output directory
writeFileSync('./dist/package.json', JSON.stringify(pkg, null, 2));
writeFileSync('./dist/README.md', readme);
writeFileSync('./dist/LICENSE', license);

0 comments on commit b1baff2

Please sign in to comment.