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

Compile also as ES6 modules for better tree-shaking #107

Closed
StefanoMagrassi opened this issue Feb 4, 2019 · 1 comment
Closed

Compile also as ES6 modules for better tree-shaking #107

StefanoMagrassi opened this issue Feb 4, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@StefanoMagrassi
Copy link
Contributor

TS sources has to be compiled also as ES6 module into a specific directory and the path has to be set in the package.json's module field.

Furthermore, the package.json's sideEffects field has to be set to false.

This will help tools like Webpack or Rollup to better apply "tree-shaking" when blundling projects which use appy.

package.json:

{
  ...
  "module": "lib/es6/index.js",
  "sideEffects": false,
  ...
}

tsconfig-compile-es6.json:

{
  "extends": "./tsconfig-compile",
  "compilerOptions": {
    "target": "es6",
    "module": "es6"
  }
}

refs:

@StefanoMagrassi StefanoMagrassi self-assigned this Feb 4, 2019
@StefanoMagrassi StefanoMagrassi added this to the v1.3.0 milestone Feb 4, 2019
@StefanoMagrassi StefanoMagrassi changed the title Compile also to as ES6 modules for better tree-shaking Compile also as ES6 modules for better tree-shaking Feb 4, 2019
@StefanoMagrassi
Copy link
Contributor Author

closed by #111

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

No branches or pull requests

1 participant