Created
March 4, 2023 12:37
-
-
Save EpicKiwi/c1ff0d2758a993142226447976837419 to your computer and use it in GitHub Desktop.
Rollup config for dependancies-included Typescript Webcomponents
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
import typescript from '@rollup/plugin-typescript'; | |
import commonjs from '@rollup/plugin-commonjs'; | |
import resolve from "@rollup/plugin-node-resolve"; | |
const COMPONENT_NAME = "my-component" | |
export default { | |
input: 'src/index.ts', | |
output: [ | |
{ | |
file: `dist/${COMPONENT_NAME}.esm.js`, | |
format: 'es', | |
sourcemap: true | |
}, | |
{ | |
name: COMPONENT_NAME, | |
file: `dist/${COMPONENT_NAME}.js`, | |
format: 'iife', | |
sourcemap: true | |
} | |
], | |
plugins: [ | |
commonjs({ extensions: ['.js', '.ts'] }), | |
resolve({browser: true}), | |
typescript({ | |
compilerOptions: { | |
module: "esnext", | |
lib: ["es5", "es6", "es2020", "dom"], | |
target: "es6", | |
} | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment