-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated build workflow to generate CJS (CommonJS) files as well as ESM (ECMAScriptModule). This resolves #43.
- Loading branch information
Showing
5 changed files
with
2,053 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { defineBuildConfig } from 'unbuild' | ||
|
||
export default defineBuildConfig({ | ||
clean: true, | ||
declaration: true, | ||
entries: [ | ||
'./src/index.ts', | ||
'./src/constants.ts', | ||
'./src/lib/field-variant.ts', | ||
'./src/parser.ts', | ||
'./src/promise/index.ts', | ||
'./src/stream/index.ts' | ||
], | ||
outDir: 'dist', | ||
rollup: { | ||
emitCJS: true, | ||
esbuild: { | ||
// reduce the overall package size by minifying the generated code. | ||
// this isn't a "perfect" solution, | ||
// but unless someone really wants to see the actual code | ||
// (which they can by simply visiting GitHub), | ||
// this will save roughly 20%. | ||
minify: true, | ||
platform: 'neutral', | ||
target: 'node16', | ||
treeShaking: true | ||
}, | ||
output: { | ||
exports: 'named', | ||
generatedCode: 'es2015' | ||
} | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.