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

Include the source code in npm package #3347

Open
chenzhutian opened this issue May 13, 2017 · 5 comments
Open

Include the source code in npm package #3347

chenzhutian opened this issue May 13, 2017 · 5 comments

Comments

@chenzhutian
Copy link

Hi, thanks for your greate work.
I'm a typescript user and use webpack to bundle my project files.
The webpack@2 has the Tree Shaking features which can reduce the size of files.
Since this feature can only work on es6, can you include the source code (the ts code are ok because I can use ts-loader to convert them), other than the production code in the npm package?

@adidahiya
Copy link
Contributor

related: palantir/blueprint#309

In blueprint, I suggested publishing ES6 / ES2015 modules in the distribution; I think plottable should do the same. You can use ts-loader to bundle the library files in either case (.ts vs ES6 .js), but I think typings resolution will be simpler if the distribution includes .d.ts and .js files.

@chenzhutian
Copy link
Author

chenzhutian commented May 14, 2017

I think both including the ts source code and publishing as es6 are OK. Is there any similar plan for portable?

@hellochar
Copy link
Contributor

Thanks for the report @chenzhutian , sounds reasonable. This should be an easy external PR - we can simply whitelist src/ in the .npmignore to include the TS. We'll be happy to accept it!

@adidahiya
Copy link
Contributor

Please verify that the compiler is able to handle .ts files inside node_modules before making this change. Make sure to test TS 2.1, 2.2, and 2.3.

@chenzhutian
Copy link
Author

After some researching, according to here microsoft/TypeScript#12358, I think the office team does not recommend to publish .ts source code for some reasons. It seems that publish the es6 code is a better choice.

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

No branches or pull requests

3 participants