parcel-transformer-geojson

0.0.4 • Public • Published

parcel-transformer-geojson

This is a parcel v2 transformer plugin that tells parcel that geojson files are, in fact, json files transforms geojson files for use in scripts.

Edit: Earlier it was just converting geojson to json, but that proved too slow (or broken) for large files. Now it uses code from the official json transformer and replicates what it does.

It was created for private use, but parcel developers made an intelligent choice here.

It probably is a good replacement for https://github.com/glukki/parcel-plugin-geojson

When do you need it?

When you do

import geojsonData from "./mydata.geojson"

and parcel says

🚨 Build failed.

@parcel/core: No transformers found for
.../mydata.geojson.

because parcel does not know that geojson is json.

Installation

npm install --save-dev parcel-transformer-geojson

Sample .parcelrc

{
  "extends": "@parcel/config-default",
  "transformers": {
    "*.geojson": ["parcel-transformer-geojson"]
  }
}

Package Sidebar

Install

npm i parcel-transformer-geojson

Weekly Downloads

6

Version

0.0.4

License

MIT

Unpacked Size

2.32 kB

Total Files

3

Last publish

Collaborators

  • asdofindia