Closed semmel closed 4 years ago
Just nitpicking, but setting the TypeScript compile target to es5 and then bundling to an ES6 module with rollup does not make sense.
es5
It may not hurt bad, except for readability and debugability for all who import dist/*.esm.js.
dist/*.esm.js
The options for the TypeScript rollup plugin permit setting the target dynamically overriding those in tsconfig.json.
tsconfig.json
E.g. plugins:[typescript({target: "es6"})]
plugins:[typescript({target: "es6"})]
Edit: I managed to quickly hack a proof of concept.
// just the edited lines in rollup.config.js import typescript from "@rollup/plugin-typescript"; // ... const plugins = [ typescript({ target: "es6", lib: ["es5", "es6", "ESNext", "dom"] }), ];
Unfortunately the upgraded TypeScript rollup plugin has a nasty bug which required some editing in tsconfig.json too:
{ "compilerOptions": { "module": "es6", "noImplicitAny": true, "target": "es5", "moduleResolution": "node" }, "include": ["src/*.ts"], "exclude": ["node_modules"] }
It was also necessary for me to npm install tslib. Being not interested in TypeScript, I have not investigated further.
npm install tslib
Btw.
https://github.com/kopiro/siriwave/pull/47
Also added MIT license.
Just nitpicking, but setting the TypeScript compile target to
es5
and then bundling to an ES6 module with rollup does not make sense.It may not hurt bad, except for readability and debugability for all who import
dist/*.esm.js
.The options for the TypeScript rollup plugin permit setting the target dynamically overriding those in
tsconfig.json
.E.g.
plugins:[typescript({target: "es6"})]
Edit: I managed to quickly hack a proof of concept.
Unfortunately the upgraded TypeScript rollup plugin has a nasty bug which required some editing in
tsconfig.json
too:It was also necessary for me to
npm install tslib
. Being not interested in TypeScript, I have not investigated further.Btw.