-
Notifications
You must be signed in to change notification settings - Fork 55
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
bundles it for the browser #113
Conversation
33b362a
to
5f70f27
Compare
package.json
Outdated
"posttest": "npm run lint && npm run test-browser", | ||
"prepublish": "npm run update", | ||
"test": "nyc mocha -R dot -r env-test", | ||
"test-browser": "testling", | ||
"test-watch": "mocha -R dot -r env-test --watch", | ||
"update": "node ./bin/update.js", | ||
"version": "npm run generate-changelog && git add CHANGELOG.md" | ||
"version": "npm run generate-changelog && git add CHANGELOG.md", | ||
"build": "browserify index.js --s tldjs > tld.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it also run npm run update
to fetch the latest version of publicsuffix list before bundling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea running npm run update
before bundling makes total sense, thanks for pointing out
what do you think about bundling in a postinstall script? i feel that can be omitted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should omit it from postinstall
? I feel like keeping commands simple and predictable is a good thing, let's not do too much at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
thanks @remusao, |
It happened before, and it seems to only fail for |
Hm, I'm not sure to understand the goal of this pull request, considering the code can already by bundled in any project using browserify/npm. Also, is there a specific lifecycle moment when |
hey @oncletom, I've been using this package for one of the projects i'm working on and I ran into this situation where I needed a bundled JS file on client-side as well, but I had to bundle it myself as you mentioned, also I saw others wanting something similar. So I just thought it would be more consistent if the package had bundled JS files as well. I originally thought that bundling should happen post installation, but changed it later. Feel free to close this PR if you think otherwise. |
Let's go ahead. It might be of the interest of cdnjs/cdnjs#8943 :-) |
this adds bundling for the browser
see #37, #89