forked from designbyadrian/react-input-with-drag
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
27 lines (24 loc) · 608 Bytes
/
build.js
File metadata and controls
27 lines (24 loc) · 608 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { build } = require('esbuild');
const { devDependencies } = require('./package.json');
const entryFile = 'src/index.tsx';
const shared = {
bundle: true,
entryPoints: [entryFile],
// Treat all dependencies in package.json as externals to keep bundle size to a minimum
external: Object.keys(devDependencies),
logLevel: 'info',
minify: true,
sourcemap: true,
};
build({
...shared,
format: 'esm',
outfile: './dist/index.esm.js',
target: ['esnext', 'node12.22.0'],
});
build({
...shared,
format: 'cjs',
outfile: './dist/index.cjs.js',
target: ['esnext', 'node12.22.0'],
});