-
-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathnpm-postinstall.mjs
More file actions
19 lines (15 loc) · 685 Bytes
/
npm-postinstall.mjs
File metadata and controls
19 lines (15 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { copyFileSync, existsSync, mkdirSync } from 'fs';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
function copyFile(src, dest) {
const target = resolve(__dirname, dest);
const targetFolder = dirname(target);
if (!existsSync(targetFolder))
mkdirSync(targetFolder, { recursive: true });
copyFileSync(resolve(__dirname, src), target);
console.log(`Copied ${src} to ${dest}`);
};
copyFile('node_modules/@dlemstra/magick-native/NOTICE', 'NOTICE');
copyFile('node_modules/@dlemstra/magick-native/magick.wasm', 'dist/magick.wasm');