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

Umd support #100

Merged
merged 6 commits into from
Jun 4, 2017
Merged

Umd support #100

merged 6 commits into from
Jun 4, 2017

Conversation

reppners
Copy link
Collaborator

@reppners reppners commented May 25, 2017

These changes introduce UMD support with declaration file enhancement by using rollup on the typescript ES2015 module output.

Basically it does the same as PR #98 (kudos to @dpogue for paving the path) but without removing the toolchain used for development/release workflow.

Will test the changes in a webpack-based project tomorrow. Global usage in demo is working fine.

  • global
  • webpack
  • systemjs / jspm

related issues #83, #94

@timruffles
Copy link
Owner

Looks great, and I'll also second your thanks to @dpogue for his excellent work!

@reppners
Copy link
Collaborator Author

Thx. Just recognized that rollup with typescript plugin won't resolve const enum's which raises output size. Looks like sourcemaps can be maintained by using another plugin and build with tsc upfront which is needed anyways for having declaration files.

rollup/rollup-plugin-typescript#28 (comment)

@dpogue
Copy link

dpogue commented May 26, 2017

Just checked the rollup config on my branch and it looked like I had to pull in rollup-plugin-sourcemaps (Although worth noting that I was running TypeScript with tsc instead of through rollup-plugin-typescript)

Currently we are getting a warning in WebPack about sourcemaps:

WARNING in ./~/drag-drop-polyfill/release/drag-drop-polyfill.min.js
(Emitted value instead of an instance of Error) Cannot find SourceMap drag-drop-polyfill.min.js.map: Error: Can't resolve './drag-drop-polyfill.min.js.map' in '<PROJECT>/node_modules/drag-drop-polyfill/release'
 @ ./demo/app.ts 11:0-54

@reppners
Copy link
Collaborator Author

reppners commented Jun 4, 2017

Build now uses tsc followed by rollup with rollup-plugin-sourcemaps. Release files now include sourcemaps.

@reppners reppners mentioned this pull request Jun 4, 2017
@reppners
Copy link
Collaborator Author

reppners commented Jun 4, 2017

Last tests with jspm/systemjs and declaration file support were succesful. export as namespace works as intended.

@reppners reppners merged commit 725be09 into rewrite Jun 4, 2017
@reppners reppners deleted the umd-support branch June 5, 2017 00:42
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

Successfully merging this pull request may close these issues.

3 participants