-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change build cjs and mjs to unbuild (#1163)
* feat: install unbuild * chore: update tsup config * chore: update eslint config * feat: add build.config.ts * fix: new lock --------- Co-authored-by: Toni Tabak <tabaktoni@gmail.com>
- Loading branch information
Showing
5 changed files
with
3,737 additions
and
1,807 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
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,46 @@ | ||
import { defineBuildConfig } from 'unbuild'; | ||
import { name, version } from './package.json'; | ||
|
||
// https://github.com/unjs/unbuild | ||
export default defineBuildConfig({ | ||
declaration: true, | ||
failOnWarn: false, | ||
rollup: { | ||
esbuild: { | ||
minify: false, | ||
}, | ||
}, | ||
entries: [ | ||
// mkdist builder transpiles file-to-file keeping original sources structure | ||
{ | ||
builder: 'mkdist', | ||
input: './src/', | ||
outDir: './dist', | ||
format: 'esm', | ||
pattern: ['**', '!**/*.test.ts'], | ||
esbuild: { | ||
define: { | ||
PACKAGE_VERSION: `"${version}"`, | ||
PACKAGE_NAME: `"${name}"`, | ||
}, | ||
}, | ||
}, | ||
{ | ||
builder: 'mkdist', | ||
input: './src/', | ||
outDir: './dist', | ||
format: 'cjs', | ||
ext: 'cjs', | ||
// https://github.com/sindresorhus/globby | ||
pattern: ['**', '!**/*.test.ts'], | ||
// Declarations already created for esm build | ||
declaration: false, | ||
esbuild: { | ||
define: { | ||
PACKAGE_VERSION: `"${version}"`, | ||
PACKAGE_NAME: `"${name}"`, | ||
}, | ||
}, | ||
}, | ||
], | ||
}); |
Oops, something went wrong.