-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yen Truong
committed
Sep 8, 2023
1 parent
66824a4
commit 4727d09
Showing
12 changed files
with
195 additions
and
28 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* \@rollup/plugin-typescript had issue with "export type": | ||
* [!] RollupError: Unexpected token (Note that you need plugins to import files that are not JavaScript) | ||
* Switched over to a fork rollup-plugin-typescript2 resolved the issue. | ||
*/ | ||
import typescript from "rollup-plugin-typescript2"; | ||
import { defineConfig } from "rollup"; | ||
|
||
export default defineConfig({ | ||
input: "src/index.ts", | ||
output: [ | ||
{ | ||
dir: "./dist/esm", | ||
/** | ||
* use mjs extension so NodeJS will recognize the bundle as ES modules | ||
* https://nodejs.org/api/packages.html#determining-module-system | ||
*/ | ||
entryFileNames: "[name].mjs", | ||
format: "esm", | ||
/** preserve original module files instead of compressing all to one file */ | ||
preserveModules: true, | ||
sourcemap: true, | ||
/** | ||
* set to "auto" to follow TypeScript's esModuleInterop behavior to ensures compatibility | ||
* of default, namespace, and dynamic imports from external deps (e.g. react-textarea-autosize). | ||
*/ | ||
interop: "auto", | ||
}, | ||
{ | ||
dir: "./dist/commonjs", | ||
format: "cjs", | ||
preserveModules: true, | ||
sourcemap: true, | ||
interop: "auto", | ||
}, | ||
], | ||
plugins: [ | ||
typescript({ | ||
tsconfig: "./tsconfig.json", | ||
}), | ||
], | ||
}); |
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 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.