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

Serve tinyfunk.js as browser-friendly script through unpkg #10

Merged
merged 2 commits into from
Aug 24, 2018

Conversation

flintinatux
Copy link
Owner

@flintinatux flintinatux commented Aug 24, 2018

dilbert-browser

Per @foxdonut's excellent suggestion, I've tweaked a few things to serve a browser-friendly build through unkpg.

closes #9

package.json Outdated
@@ -23,7 +24,7 @@
"branches": 100
},
"scripts": {
"build": "./node_modules/uglify-es/bin/uglifyjs src.js -cm --toplevel > tinyfunk.js",
"build": "./node_modules/uglify-es/bin/uglifyjs src.js -cm --toplevel --wrap tinyfunk > tinyfunk.js",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tip, npm is smart enough to have node_modules on its path, so if you'd like, you could reduce this to

"build": "uglifyjs src.js -cm --toplevel --wrap tinyfunk > tinyfunk.js",

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. I originally included that relative path because at one point I was also building an es5 bundle, and had both uglify-js and uglify-es as deps. Sadly, they share the same executable name, so it always called the wrong one. The relative path fixed that by calling the one I wanted explicitly.

I removed the es5 build at some point, but forgot to change this command. Good find.

Copy link

@foxdonut foxdonut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, thanks @flintinatux !

I think it will be very convenient to be able to experiment with tinyfunk quickly with http://flems.io/tinyfunk and, if one wishes, to load the script with http://unpkg.com/tinyfunk.

@flintinatux
Copy link
Owner Author

tiny squirrel

@flintinatux flintinatux merged commit 27f52cc into master Aug 24, 2018
@flintinatux flintinatux deleted the unpkg branch August 24, 2018 18:26
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.

Browser <script> tag friendly build
2 participants