Skip to content

Commit

Permalink
FIX #172 jsnext:main points to es7 instead of es6
Browse files Browse the repository at this point in the history
  • Loading branch information
pubkey committed May 16, 2017
1 parent 09570fe commit d3a14cc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
27 changes: 17 additions & 10 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"presets": ["es2015"],
"plugins": [
[
"transform-async-to-generator",
"transform-runtime", {
"polyfill": false,
"regenerator": false
}
]
]
"env": {
"es5": {
"presets": ["es2015"],
"plugins": [
[
"transform-async-to-generator",
"transform-runtime", {
"polyfill": false,
"regenerator": false
}
]
]
},
"es6": {
"presets": ["es2017"]
}
}
}
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,23 @@
],
"license": "Apache-2.0",
"main": "./dist/lib/index.js",
"jsnext:main": "./src/index.js",
"module": "./src/index.js",
"jsnext:main": "./dist/es/index.js",
"module": "./dist/es/index.js",
"types": "./src/index.d.ts",
"scripts": {
"pretest": "npm run transpile",
"test": "gulp --gulpfile ./config/gulpfile.js test && karma start ./config/karma.conf.js",
"test:node": "npm run pretest && gulp --gulpfile ./config/gulpfile.js test",
"test:browser": "npm run pretest && karma start ./config/karma.conf.js",
"dockertest": "docker run -it -v $(pwd):/usr/src/app markadams/chromium-xvfb-js:latest-onbuild",
"clear": "rimraf -rf test_tmp/ && rimraf -rf dist/lib/ && rimraf .transpile_state.json",
"clear": "rimraf -rf test_tmp/ && rimraf -rf dist/ && rimraf .transpile_state.json",
"lint": "eslint --ignore-path ./config/.eslintignore src test ./config/gulpfile.js",
"transpile:clean": "rimraf dist/lib",
"transpile": "node scripts/transpile.js",
"build:es": "cross-env NODE_ENV=es6 babel src --out-dir dist/es",
"build:rollup": "rollup -c --environment UGLIFY:true --config ./config/rollup.config.js && rollup -c --environment UGLIFY:false --config ./config/rollup.config.js",
"build:webpack": "webpack --optimize-minimize --config ./config/webpack.config.js",
"build": "npm run clear && npm run transpile && browserify dist/lib/browserify.index.js > dist/rxdb.browserify.js && uglifyjs --compress --mangle --output dist/rxdb.browserify.min.js -- dist/rxdb.browserify.js",
"build": "npm run clear && npm run transpile && npm run build:es && browserify dist/lib/browserify.index.js > dist/rxdb.browserify.js && uglifyjs --compress --mangle --output dist/rxdb.browserify.min.js -- dist/rxdb.browserify.js",
"disc": "npm run transpile && browserify dist/lib/index.js --full-paths | uglifyjs --compress --mangle | discify --open --full-paths",
"preversion": "npm run lint && npm run test",
"dev": "watch 'npm run test:node' src/ test/",
Expand Down Expand Up @@ -81,6 +83,7 @@
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.0",
"babel-preset-es2015-rollup": "3.0.0",
"babel-preset-es2017": "^6.24.1",
"babelrc-rollup": "3.0.0",
"brfs": "1.4.3",
"browserify": "^14.1.0",
Expand Down
2 changes: 2 additions & 0 deletions scripts/transpile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
process.env['NODE_ENV'] = 'es5';

/**
* runs the babel-transpile
* remembers mtime of files and only transpiles the changed ones
Expand Down

0 comments on commit d3a14cc

Please sign in to comment.