-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build(deps)!: update dependencies and minimum supported node version * build(rollup): update rollup configuration to support rollup 3 * build(tsconfig)!: update target and lib to es2020 bumped to es2020 in accordance with https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping * ci(test): set node versions to 14, 16 and 18 * chore: bump versio to 9.0.0 (major)
- Loading branch information
1 parent
b65077d
commit fe3c0fa
Showing
7 changed files
with
127 additions
and
135 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
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// rollup.config.mjs | ||
import typescript from '@rollup/plugin-typescript' | ||
import dts from 'rollup-plugin-dts' | ||
import esbuild from 'rollup-plugin-esbuild' | ||
import externals from 'rollup-plugin-node-externals' | ||
|
||
const usePreferConst = true // Use "const" instead of "var" | ||
const usePreserveModules = true // `true` -> keep modules structure, `false` -> combine everything into a single file | ||
const useStrict = true // Use "strict" | ||
const useThrowOnError = true // On error throw and exception | ||
const useSourceMap = true // Generate source map files | ||
const useEsbuild = true // `true` -> use esbuild, `false` use tsc | ||
// Currently the `esbuild` plugin has not been updated for rollup 3 | ||
// But it is working. In case it does not work anymore se this flag to `false` | ||
|
||
export default [ | ||
{ | ||
// .d.ts build | ||
input: 'src/index.ts', | ||
output: { | ||
file: 'dist/index.d.ts', | ||
format: 'es' | ||
}, | ||
plugins: [externals(), dts()] | ||
}, | ||
{ | ||
// CJS build | ||
input: 'src/index.ts', | ||
output: { | ||
dir: 'dist/cjs', | ||
format: 'cjs', | ||
generatedCode: { | ||
constBindings: usePreferConst | ||
}, | ||
preserveModules: usePreserveModules, | ||
strict: useStrict, | ||
entryFileNames: '[name].cjs', | ||
sourcemap: useSourceMap | ||
}, | ||
plugins: [ | ||
externals(), | ||
useEsbuild | ||
? esbuild() | ||
: typescript({ | ||
noEmitOnError: useThrowOnError, | ||
outDir: 'dist/cjs', | ||
removeComments: true | ||
}) | ||
] | ||
}, | ||
{ | ||
// ESM builds | ||
input: 'src/index.ts', | ||
output: { | ||
dir: 'dist/esm', | ||
format: 'es', | ||
generatedCode: { | ||
constBindings: usePreferConst | ||
}, | ||
preserveModules: usePreserveModules, | ||
strict: useStrict, | ||
entryFileNames: '[name].mjs', | ||
sourcemap: useSourceMap | ||
}, | ||
plugins: [ | ||
externals(), | ||
useEsbuild | ||
? esbuild() | ||
: typescript({ | ||
noEmitOnError: useThrowOnError, | ||
outDir: 'dist/esm', | ||
removeComments: true | ||
}) | ||
] | ||
} | ||
] |
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