Skip to content

Commit

Permalink
Merge pull request #4 from ewerk/feature/build-artifact
Browse files Browse the repository at this point in the history
Introduce distribution artifact
  • Loading branch information
iceteabottle authored Oct 11, 2024
2 parents be91a56 + ad4d353 commit 8eb2501
Show file tree
Hide file tree
Showing 5 changed files with 700 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.idea
/node_modules
/dist
24 changes: 24 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const esbuild = require('esbuild');

const commonConfig = {
entryPoints: ['./src/index.ts'],
target: [
'esnext',
'node20',
],
bundle: true,
minify: true,
treeShaking: true,
};

esbuild.buildSync({
...commonConfig,
format: 'cjs',
outfile: './dist/index.cjs.js',
});

esbuild.buildSync({
...commonConfig,
format: 'esm',
outfile: './dist/index.esm.js',
});
Loading

0 comments on commit 8eb2501

Please sign in to comment.