From f480b05366d8e7e824bdc95238c31d1ae29c6fe9 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Tue, 14 Mar 2017 11:57:54 -0700 Subject: [PATCH] Compile ES2015 modules with ES5 target --- package.json | 2 ++ scripts/single-file-build.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 90da59838..9c7072142 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,8 @@ "version": "3.1.7", "description": "Simple, scalable state management.", "main": "lib/mobx.js", + "module": "lib/es2015/mobx.js", + "jsnext:main": "lib/es2015/mobx.js", "umd:main": "lib/mobx.umd.js", "typings": "lib/mobx.d.ts", "scripts": { diff --git a/scripts/single-file-build.js b/scripts/single-file-build.js index 4fbbfffee..98e8cc2e3 100644 --- a/scripts/single-file-build.js +++ b/scripts/single-file-build.js @@ -37,7 +37,7 @@ fs.writeFileSync('.build/mobx.ts', allContents, { encoding: 'utf8', flag: 'a' }) [ 'tsc -m commonjs -t es5 -d --removeComments --outDir lib .build/mobx.ts', -// 'tsc -m es2015 -t es2015 -d --removeComments --outDir lib/es2015 .build/mobx.ts', + 'tsc -m es2015 -t es5 -d --removeComments --outDir lib/es2015 .build/mobx.ts', 'browserify -s mobx -e lib/mobx.js -o lib/mobx.umd.js', `uglifyjs -m sort,toplevel -c --screw-ie8 --preamble "/** MobX - (c) Michel Weststrate 2015, 2016 - MIT Licensed */" --source-map lib/mobx.min.js.map -o lib/mobx.min.js lib/mobx.js`, `uglifyjs -m sort,toplevel -c --screw-ie8 --preamble "/** MobX - (c) Michel Weststrate 2015, 2016 - MIT Licensed */" --source-map lib/mobx.umd.min.js.map -o lib/mobx.umd.min.js lib/mobx.umd.js`,