Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Commit 978760e

Browse files
add proper build for jsnext:main
1 parent 3927797 commit 978760e

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

.babelrc

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
{
2-
"presets": [ "modern-node/0.12", "stage-2" ]
2+
"env": {
3+
"cjs":{
4+
"presets": [
5+
[ "modern-node", { "version": "0.12", "modules": "commonjs" } ],
6+
"stage-2"
7+
]
8+
},
9+
"es":{
10+
"presets": [
11+
[ "modern-node", { "version": "0.12", "modules": false } ],
12+
"stage-2"
13+
]
14+
},
15+
}
316
}

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# build artefacts
22
/build/
3+
/build-es/
34

45
# npm
56
/node_modules/
67
/npm-debug.log
78
/redux-storage-*.tgz
8-

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ mrproper: clean
3030

3131
build: clean install
3232
echo "> Building ..."
33-
$(BIN)/babel src/ --out-dir build/
33+
BABEL_ENV=cjs $(BIN)/babel src/ --out-dir build/
34+
BABEL_ENV=es $(BIN)/babel src/ --out-dir build-es/
3435

3536
build-watch: clean install
3637
echo "> Building forever ..."
37-
$(BIN)/babel src/ --out-dir build/ --watch
38+
BABEL_ENV=cjs $(BIN)/babel src/ --out-dir build/ --watch
3839

3940
#
4041
# TEST

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "4.1.0",
44
"description": "Persistence layer for redux with flexible backends",
55
"main": "build/index.js",
6-
"jsnext:main": "src/index.js",
6+
"jsnext:main": "build-es/index.js",
77
"scripts": {
88
"test": "make lint test build"
99
},
@@ -26,6 +26,7 @@
2626
"author": "Michael Contento <[email protected]>",
2727
"files": [
2828
"build/",
29+
"build-es/",
2930
"src",
3031
"!**/__tests__/**"
3132
],
@@ -37,7 +38,7 @@
3738
"babel-cli": "^6.11.4",
3839
"babel-core": "^6.11.4",
3940
"babel-polyfill": "^6.9.1",
40-
"babel-preset-modern-node": "^2.2.1",
41+
"babel-preset-modern-node": "^3.0.0",
4142
"babel-preset-stage-2": "^6.11.0",
4243
"eslint": "^1.10.3",
4344
"eslint-config-michaelcontento": "^1.1.1",

0 commit comments

Comments
 (0)