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

Run browserify on NPM prepublish #52

Closed
wants to merge 1 commit into from

Conversation

IvanSanchez
Copy link
Contributor

Kinda bringing #24 back from the dead (I expect browser builds after running npm install geojson-vt), but implemented in the same nice way as Leaflet/Leaflet#1573

@@ -34,6 +34,7 @@
"coveralls": "npm run cov && coveralls < ./coverage/lcov.info",
"build-min": "browserify src/index.js -s geojsonvt | uglifyjs -c -m -o geojson-vt.js",
"build-dev": "browserify -d src/index.js -s geojsonvt -o geojson-vt-dev.js",
"watch": "watchify -v -d src/index.js -s geojsonvt -o geojson-vt-dev.js"
"watch": "watchify -v -d src/index.js -s geojsonvt -o geojson-vt-dev.js",
"prepublish": "browserify -d src/index.js -s geojsonvt -o geojson-vt-dev.js; browserify src/index.js -s geojsonvt | uglifyjs -c -m -o geojson-vt.js"
Copy link
Member

Choose a reason for hiding this comment

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

let's compose other npm scripts (e.g. npm run build-min) rather than copypasting

@mourner
Copy link
Member

mourner commented Mar 3, 2016

Also, if we want the build files to get into NPM, we have to add .npmignore file, otherwise everything that's in gitignore won't be published.

@IvanSanchez
Copy link
Contributor Author

There is already a .npmignore file, which is explicitly ignoring the built files. I need to clean some things up, refactor scripts a bit, edit .npmignore, and amend the commit.

@mourner
Copy link
Member

mourner commented Mar 3, 2016

@IvanSanchez nope, there's only .gitignore.

@IvanSanchez
Copy link
Contributor Author

Oh for the noodles of the FSM, I'm looking inside node_modules/geojson-vt/.npmignore. Need moar caffeine.

@IvanSanchez IvanSanchez force-pushed the master branch 3 times, most recently from 7ccbf98 to 41a7ef6 Compare March 7, 2016 09:46
@IvanSanchez
Copy link
Contributor Author

@mourner I hope the updated commit should do the trick.

@@ -14,7 +14,7 @@
"type": "git",
"url": "git://github.com/mapbox/geojson-vt.git"
},
"main": "src/index.js",
"main": "geojson-vt-dev.js",
Copy link
Member

Choose a reason for hiding this comment

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

Why change the main entry point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I'd like to have the bundled file ready for loading it up in a web browser. On second thought, we could use the browser field of package.json as explained here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why? If you're using browserify or rollup or etc, it'll handle the main file just fine. I don't see any reason to include browser or change main of this project. Running browserify on prepublish will be nice if we want an npmcdn workflow, but it should be tightly scoped to that need, not change essential stuff like the main entry

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, main should remain src/index.js.

@mourner
Copy link
Member

mourner commented Aug 9, 2016

Merged with some tweaks as 12eb850

@mourner mourner closed this Aug 9, 2016
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.

None yet

3 participants