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

Dist contains const #11

Closed
janvanhelvoort opened this issue Nov 16, 2017 · 3 comments
Closed

Dist contains const #11

janvanhelvoort opened this issue Nov 16, 2017 · 3 comments
Assignees
Labels

Comments

@janvanhelvoort
Copy link

Hi,

When building our source with gulp and we use 'gulp-uglify' the following error occurs:

GulpUglifyError: unable to minify JavaScript
Caused by: SyntaxError: Unexpected token: keyword (const)
File: C:\dev\static\build\js\app.min.js
Line: 26603

line 26603: !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):t.wretch=r()}(this,function(){"use strict";const t=Objec ....

Thank you!

Jan

@elbywan
Copy link
Owner

elbywan commented Nov 16, 2017

Hi @janvanhelvoort, thanks for pointing this out !

This is related to a rollup-typescript issue : rollup/rollup-plugin-typescript#86

Just fixed that in the dev branch, could you check it out by running npm install https://github.com/elbywan/wretch#dev and tell me if everything is okay ?

Thanks !

PS: By the way the dist/bundle/wretch.js file is already minified ! Did you consider using the dist/index.js file as an es2015 entry point instead ?

@janvanhelvoort
Copy link
Author

yes, it works with the dev branch.

Do you have a link or example about es2015 entry point?

@elbywan
Copy link
Owner

elbywan commented Nov 16, 2017

Great, thanks for letting me know 👍 !
I will publish a new release in the following days containing the fix.

Regarding the entry point it really depends on your build system.

If you are using webpack for instance you can tweak it by using the "module" field as explained in the doc.

Also, rollup has a nice wiki page about it and the benefits of es2015 modules.

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

2 participants