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

bundles it for the browser #113

Merged
merged 4 commits into from
Feb 2, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ coverage*
.nyc_output

rules.json
tld.js
tld.min.js
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
"benchmark": "node ./bin/benchmark.js",
"generate-changelog": "github-changes -o oncletom -r 'tld.js' -n ${npm_package_version} --only-pulls --use-commit-body",
"lint": "jshint --config .jshintrc lib/**/*.js",
"postinstall": "node ./bin/postinstall.js",
"postinstall": "node ./bin/postinstall.js && npm run build && npm run build-min",
"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",
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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.

"build-min": "browserify index.js --s tldjs | uglifyjs -c > tld.min.js"
},
"tldjs": {
"providers": {
Expand Down Expand Up @@ -66,7 +68,9 @@
"mocha": "^3.5.0",
"nyc": "^11.1.0",
"phantomjs-prebuilt": "^2.1.15",
"testling": "^1.7.0"
"testling": "^1.7.0",
"browserify": "^14.5.0",
"uglify-js": "^3.1.9"
},
"keywords": [
"tld",
Expand Down