Skip to content

Commit ebdb1f7

Browse files
committed
chore: copy typings file to built folders
1 parent 70356a5 commit ebdb1f7

File tree

3 files changed

+224
-1
lines changed

3 files changed

+224
-1
lines changed

build.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ const process = require('process');
55
const isCI = require('is-ci');
66
const fg = require('fast-glob');
77
const esbuild = require('esbuild');
8+
const { copy } = require('esbuild-plugin-copy');
89

910
const isEsmBuild = process.argv[2] !== '--cjs';
1011

12+
const copyTypingsPlugin = copy({
13+
assets: [{ from: ['./typings.d.ts'], to: ['./typings.d.ts'] }],
14+
});
15+
1116
const config = {
1217
cjs: {
1318
format: 'cjs',
1419
platform: 'node',
1520
outdir: './lib/cjs',
21+
plugins: [copyTypingsPlugin],
1622
},
1723
esm: {
1824
format: 'esm',
@@ -33,6 +39,7 @@ const config = {
3339
});
3440
},
3541
},
42+
copyTypingsPlugin,
3643
],
3744
},
3845
};

package-lock.json

Lines changed: 215 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"exports": {
88
".": {
99
"require": "./lib/cjs/index.js",
10-
"default": "./lib/esm/index.mjs"
10+
"default": "./lib/esm/index.mjs"
1111
}
1212
},
1313
"module": "./lib/esm/index.mjs",
@@ -60,6 +60,7 @@
6060
"ajv": "^8.8.2",
6161
"esbuild": "^0.14.0",
6262
"esbuild-jest": "^0.5.0",
63+
"esbuild-plugin-copy": "^2.1.1",
6364
"eslint": "^8.3.0",
6465
"eslint-config-prettier": "^8.3.0",
6566
"eslint-plugin-jest": "^26.0.0",

0 commit comments

Comments
 (0)