mapbox/martini

NPM package isn't published in es5

chrisgervang opened this issue · 0 comments

While trying to use Martini in a deck.gl terrain layer, I discovered the NPM package isn't transpiled to es5 (pure JS developers would run into syntax issues).

Could you publish an es5 version as the default along side es6 distributable?

Screen Shot 2020-02-03 at 6 45 55 PM

You might find this article useful, it seems most folks are using babel (and this plugin) to do the transpiling.
Here's a snippet of their rollup config.

babel({
    // ignore node_modules/ in transpilation process
    exclude: 'node_modules/**',
    // ignore .babelrc (if defined) and use options defined here
    babelrc: false,
    // use recommended babel-preset-env without es modules enabled
    // and with possibility to set custom targets e.g. { node: '8' }
    presets: [['env', { modules: false, targets }]],
    // solve a problem with spread operator transpilation https://github.com/rollup/rollup/issues/281
    plugins: ['babel-plugin-transform-object-rest-spread'],
    // removes comments from output
    comments: false,
  }),