Skip to content
Permalink
Browse files

Change "module" *.mjs extension to *.es.js

  • Loading branch information
DenisCarriere committed Dec 10, 2017
1 parent e72b28f commit 659d1ff70a361cf847f27a51ec25ea7be7ee79c6
Showing with 15 additions and 13 deletions.
  1. +2 −0 packages/turf/.gitignore
  2. +2 −2 packages/turf/package.json
  3. +6 −7 packages/turf/rollup.config.js
  4. +2 −2 rollup.config.js
  5. +3 −2 scripts/set-uniforms
@@ -3,5 +3,7 @@ turf.js.map
turf.mjs
turf.mjs.map
turf.min.js
turf.es.js
turf.es.js.map
turf.min.js.map
test.example.js
@@ -3,14 +3,14 @@
"version": "5.1.3",
"description": "a JavaScript library for performing geospatial operations with GeoJSON",
"main": "turf.js",
"module": "turf.mjs",
"module": "turf.es.js",
"browser": "turf.min.js",
"types": "index.d.ts",
"files": [
"index.js",
"index.d.ts",
"turf.js",
"turf.mjs",
"turf.es.js",
"turf.min.js"
],
"scripts": {
@@ -1,23 +1,22 @@
import node from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import uglify from 'rollup-plugin-uglify'
import pckg from './package.json'

const input = 'index.js'

export default [{
input,
output: [
{file: 'turf.mjs', format: 'es'},
{file: 'turf.js', format: 'cjs'},
{file: pckg.main, format: 'umd', name: 'turf'},
{file: pckg.module, format: 'es'},
],
plugins: [commonjs(), node()]
},
{
input,
output: {
file: 'turf.min.js',
format: 'umd',
name: 'turf'
},
output: [
{file: pckg.browser, format: 'umd', name: 'turf'}
],
plugins: [commonjs(), node(), uglify()]
}];
@@ -3,8 +3,8 @@ import typescript from './rollup-plugins/typescript-export';
export default {
input: 'index.js',
output: [
{file: 'main.mjs', format: 'es'},
{file: 'main.js', format: 'cjs'}
{file: 'main.js', format: 'cjs'},
{file: 'main.es.js', format: 'es'}
],
plugins: [typescript()]
}
@@ -12,14 +12,15 @@ glob.sync(path.join(__dirname, '..', 'packages', 'turf-*', 'package.json')).forE
files.add('index.js');
files.add('index.d.ts');
files.add('main.js');
files.add('main.mjs');
files.add('main.es.js');
files.delete('main.mjs');

const newPckg = {
name: pckg.name,
version: pckg.version,
description: pckg.description,
main: 'main.js',
module: 'main.mjs',
module: 'main.es.js',
types: 'index.d.ts',
files: [...files],
scripts: {

0 comments on commit 659d1ff

Please sign in to comment.
You can’t perform that action at this time.