Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit fb68060

Browse files
committed
build: copy assets
1 parent edc4a57 commit fb68060

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
"ng": "ng",
66
"start": "ng serve",
77
"dev": "ng build --watch",
8-
"build": "ng build --prod",
8+
"build": "ng build --prod & copy",
99
"test": "ng test",
1010
"lint": "ng lint",
11-
"e2e": "ng e2e"
11+
"e2e": "ng e2e",
12+
"copy": "node ./scripts/copy.mjs"
1213
},
1314
"private": true,
1415
"dependencies": {
@@ -46,4 +47,4 @@
4647
"tslint": "~6.1.0",
4748
"typescript": "~4.0.2"
4849
}
49-
}
50+
}

scripts/copy.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { copyFile } from 'fs';
2+
import { dirname, resolve } from 'path';
3+
import { fileURLToPath } from 'url';
4+
5+
const DIRNAME = dirname(fileURLToPath(import.meta.url));
6+
7+
['README.md', 'LICENSE'].forEach(file => {
8+
copyFile(
9+
resolve(DIRNAME, '..', file),
10+
resolve(DIRNAME, '..', 'dist', 'ngx-socketio2', file),
11+
error => error && console.log(error)
12+
);
13+
});

0 commit comments

Comments
 (0)