diff --git a/.babelrc b/.babelrc index 09bc2e93c..10b4a03b3 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,12 @@ { - "presets": ["es2015-loose", "stage-0", "react"], - "plugins": [ - "transform-decorators-legacy" - ] + "env": { + "development": { + "presets": ["es2015-loose", "stage-0", "react"], + "plugins": ["transform-decorators-legacy"] + }, + "buildmodule": { + "presets": ["es2015-loose-rollup", "stage-0", "react"], + "plugins": ["transform-decorators-legacy"] + } + } } diff --git a/.gitignore b/.gitignore index dbb9d4c83..2aedfa984 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ npm-debug.log .DS_Store dist lib +mod coverage diff --git a/package.json b/package.json index 9b95d86f8..e33cb33cd 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,14 @@ "version": "4.0.6", "description": "Official React bindings for Redux", "main": "./lib/index.js", - "jsnext:main": "./src/index.js", + "jsnext:main": "./mod/index.js", "scripts": { "build:lib": "babel src --out-dir lib", + "build:mod": "BABEL_ENV=buildmodule babel src --out-dir mod", "build:umd": "webpack src/index.js dist/react-redux.js --config webpack.config.development.js", "build:umd:min": "webpack src/index.js dist/react-redux.min.js --config webpack.config.production.js", - "build": "npm run build:lib && npm run build:umd && npm run build:umd:min", - "clean": "rimraf lib dist coverage", + "build": "npm run build:lib && npm run build:mod && npm run build:umd && npm run build:umd:min", + "clean": "rimraf lib mod dist coverage", "lint": "eslint src test", "prepublish": "npm run clean && npm run build", "test": "mocha --compilers js:babel-core/register --recursive --require ./test/setup.js", @@ -23,7 +24,7 @@ "files": [ "dist", "lib", - "src" + "mod" ], "keywords": [ "react", @@ -49,6 +50,7 @@ "babel-loader": "^6.2.0", "babel-plugin-transform-decorators-legacy": "^1.2.0", "babel-preset-es2015-loose": "^6.1.4", + "babel-preset-es2015-loose-rollup": "^7.0.0", "babel-preset-react": "^6.3.13", "babel-preset-stage-0": "^6.3.13", "eslint": "^1.7.1",