Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build TypeScript target version does not match Rollup output type #43

Closed
semmel opened this issue May 20, 2020 · 1 comment
Closed

Build TypeScript target version does not match Rollup output type #43

semmel opened this issue May 20, 2020 · 1 comment

Comments

@semmel
Copy link
Contributor

semmel commented May 20, 2020

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.

// 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.

Btw.

  1. I did not find any license for siriwave. We're a very small company and would perhaps use it in one of our products.
  2. We really like your work, it's a really artistic visualisation.
@kopiro
Copy link
Owner

kopiro commented Jun 12, 2020

#47

Also added MIT license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants