generated from antfu/starter-ts
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds build config for min and modular imports
- Loading branch information
Harsh Kumar Choudhary
authored and
Harsh Kumar Choudhary
committed
Mar 11, 2024
1 parent
42a2a3f
commit 18d9c29
Showing
5 changed files
with
119 additions
and
51 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 |
---|---|---|
@@ -1,12 +1,38 @@ | ||
import { defineBuildConfig } from 'unbuild' | ||
|
||
export default defineBuildConfig({ | ||
entries: [ | ||
'src/index', | ||
], | ||
declaration: true, | ||
clean: true, | ||
rollup: { | ||
emitCJS: true, | ||
export default defineBuildConfig([ | ||
{ | ||
// If entries is not provided, will be automatically inferred from package.json | ||
entries: [ | ||
'./src/index', | ||
// mkdist builder transpiles file-to-file keeping original sources structure | ||
{ | ||
builder: 'mkdist', | ||
input: './src/', | ||
outDir: './dist/', | ||
}, | ||
], | ||
|
||
/** | ||
* `compatible` means "src/index.ts" will generate "dist/index.d.mts", "dist/index.d.cts" and "dist/index.d.ts". | ||
* `node16` means "src/index.ts" will generate "dist/index.d.mts" and "dist/index.d.cts". | ||
* `true` is equivalent to `compatible`. | ||
* `false` will disable declaration generation. | ||
* `undefined` will auto detect based on "package.json". If "package.json" has "types" field, it will be `"compatible"`, otherwise `false`. | ||
*/ | ||
declaration: 'compatible', | ||
failOnWarn: false, | ||
}, | ||
{ | ||
name: 'minified', | ||
entries: ['./src/index'], | ||
outDir: './dist/min', | ||
rollup: { | ||
esbuild: { | ||
minify: true, | ||
}, | ||
emitCJS: true, | ||
}, | ||
failOnWarn: false, | ||
}, | ||
}) | ||
]) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
export { IdleQueue } from './idleQueue' | ||
export { defineIdleProperty } from './defineIdleProperty' | ||
export { defineIdleProperties } from './defineIdleProperties' | ||
export { cIC, rIC } from './idleCbWithPolyfill' | ||
export { IdleValue } from './idleValue' | ||