-
Notifications
You must be signed in to change notification settings - Fork 12
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 rollup integration
- Loading branch information
Igo Lapa
committed
May 4, 2023
1 parent
4fa5640
commit c63e6d7
Showing
3 changed files
with
183 additions
and
46 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,58 @@ | ||
import { terser } from 'rollup-plugin-terser' | ||
import peerDepsExternal from 'rollup-plugin-peer-deps-external' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import typescript from 'rollup-plugin-typescript2' | ||
import dtsBundle from 'rollup-plugin-dts-bundle' | ||
import injectProcessEnv from 'rollup-plugin-inject-process-env' | ||
import packageJson from './package.json' assert { type: 'json' } | ||
|
||
const globals = { | ||
...packageJson.dependencies, | ||
} | ||
|
||
export default [ | ||
{ | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
inlineDynamicImports: true, | ||
file: packageJson.main, | ||
format: 'cjs', // commonJS | ||
sourcemap: true, | ||
}, | ||
{ | ||
inlineDynamicImports: true, | ||
file: packageJson.module, | ||
format: 'es', // ES Modules | ||
sourcemap: true, | ||
}, | ||
], | ||
plugins: [ | ||
peerDepsExternal(), | ||
resolve({ | ||
preferBuiltins: true, | ||
}), | ||
commonjs(), | ||
typescript({ | ||
clean: true, | ||
}), | ||
dtsBundle({ | ||
bundle: { | ||
name: packageJson.name, | ||
main: 'dist/index.d.ts', | ||
}, | ||
verbose: true, | ||
}), | ||
commonjs({ | ||
exclude: 'node_modules', | ||
ignoreGlobal: true, | ||
}), | ||
injectProcessEnv({ | ||
npm_package_version: packageJson.version, | ||
}), | ||
terser(), | ||
], | ||
external: [...Object.keys(globals)], | ||
}, | ||
] |
Oops, something went wrong.