Example for creating custom builds for use in the browser
hupe13 opened this issue · comments
hupe13 commented
- turf version 6.5.0
- https://turfjs.org/getting-started
- Creating custom builds for use in the browser
I installed the modules I need:
npm install @turf/helpers
npm install @turf/boolean-point-in-polygon
npm install @turf/meta
The main.js:
module.exports = {
helpers: require('@turf/helpers'),
booleanPointInPolygon: require('@turf/boolean-point-in-polygon').default,
meta: require('@turf/meta')
};
Then I can use after browserify and loading the outTurf.js:
turf.helpers.point()
turf.booleanPointInPolygon()
turf.meta.flattenEach()
I spent a lot of time until this worked. Maybe it will help others.
James Milner commented
Thanks for sharing! I will close this but it will still be searchable if people find it helpful.