mapbox / geojson-vt

Slice GeoJSON into vector tiles on the fly in the browser
ISC License
1.88k stars 272 forks source link

Put file extensions in src #137

Closed m0ose closed 4 years ago

m0ose commented 4 years ago

First, this is a great library. I am encountering a tiny problem while trying to use it as standard ES6 modules. It works great on my machine, but when I deploy it to an Apache server it complains about the file extensions missing.

For example:

import simplify from './simplify';
import createFeature from './feature';

would chnage to

import simplify from './simplify.js';
import createFeature from './feature.js';

I know all of the cool people are dropping the .js extension but I really don't see the benefit.

mourner commented 4 years ago

@m0ose yes, that makes sense, especially given that recent Node.js ESM modules spec updates introduced preference for explicit resolution. Want to make a PR for this?

m0ose commented 4 years ago

Yes. I can do that.

m0ose commented 4 years ago

I made a PR, #138. Is this the correct way to make a pull request?

PS, I get credit through Hactoberfest if this gets accepted in October.

mourner commented 4 years ago

@m0ose oh no, sorry for merging this 3 days earlier — read your comment too late!