Skip to content

Commit

Permalink
build commonjs and es versions (#194)
Browse files Browse the repository at this point in the history
* build commonjs and es versions
  • Loading branch information
joeduncan authored and Pomax committed Jun 6, 2017
1 parent d7bec1c commit 6d5d241
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 316 deletions.
18 changes: 18 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"env": {
"commonjs": {
"presets": [ "env", "stage-0" ]
},
"es": {
"presets": [
[
"env",
{
"modules": false
}
],
"stage-0"
]
}
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
lib
es
279 changes: 0 additions & 279 deletions index.js

This file was deleted.

23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"name": "react-onclickoutside",
"version": "6.0.0",
"description": "An onClickOutside wrapper for React components",
"main": "./index.js",
"module": "./index.js",
"jsnext:main": "./index.js",
"main": "lib/index.js",
"module": "es/index.js",
"jsnext:main": "es/index.js",
"files": [
"index.js"
"es",
"lib"
],
"homepage": "https://github.com/Pomax/react-onclickoutside",
"authors": [
Expand All @@ -28,7 +29,9 @@
"url": "https://github.com/Pomax/react-onclickoutside/issues"
},
"scripts": {
"build": "rollup -c -i src/index.js -o ./index.js",
"build": "npm run build:es && npm run build:commonjs",
"build:es": "cross-env BABEL_ENV=es babel src -d es",
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src -d lib",
"lint": "eslint src/*.js ./test",
"test": "run-s test:**",
"test:basic": "run-s lint build",
Expand All @@ -40,9 +43,10 @@
"babel-cli": "^6.24.1",
"babel-eslint": "^7.2.3",
"babel-loader": "^6.x",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.5.1",
"babel-preset-stage-0": "^6.24.1",
"chai": "^3.5.0",
"cross-env": "^5.0.0",
"eslint": "^3.4.0",
"husky": "^0.13.3",
"karma": "^1.4.0",
Expand Down Expand Up @@ -70,11 +74,6 @@
"react": "^15.5.x",
"react-dom": "^15.5.x"
},
"babel": {
"plugins": [
"transform-class-properties"
]
},
"lint-staged": {
"{src,test}/**/*.js": [
"prettier --print-width=120 --single-quote --trailing-comma=all --write",
Expand Down
23 changes: 0 additions & 23 deletions rollup.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ module.exports = function(config) {
test: /.js$/,
loader: 'babel',
query: {
presets: [['es2015', { loose: true }]],
plugins: ['transform-class-properties'],
presets: ['env', 'stage-0'],
},
},
],
Expand Down

0 comments on commit 6d5d241

Please sign in to comment.