Skip to content

Commit

Permalink
fix(ESM): Add [operators|ajax|websocket|testing]/package.json for ESM…
Browse files Browse the repository at this point in the history
… support, fixes #3227 (#3356)
  • Loading branch information
jayphelps authored and benlesh committed Mar 2, 2018
1 parent 52cdfe8 commit 725dcb4
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .make-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ fs.removeSync(PKG_ROOT);
let rootPackageJson = Object.assign({}, pkg, {
name: 'rxjs',
main: './index.js',
typings: './index.d.ts'
typings: './index.d.ts',
module: './_esm5/index.js',
es2015: './_esm2015/index.js'
});

// Get a list of the file names. Sort in reverse order so re-export files
Expand Down Expand Up @@ -102,6 +104,10 @@ copySources(ESM2015_ROOT, ESM2015_PKG, true);
fs.copySync('./tsconfig.json', PKG_ROOT + 'src/tsconfig.json');

fs.writeJsonSync(PKG_ROOT + 'package.json', rootPackageJson);
fs.copySync('src/operators/package.json', PKG_ROOT + '/operators/package.json');
fs.copySync('src/ajax/package.json', PKG_ROOT + '/ajax/package.json');
fs.copySync('src/websocket/package.json', PKG_ROOT + '/websocket/package.json');
fs.copySync('src/testing/package.json', PKG_ROOT + '/testing/package.json');

if (fs.existsSync(UMD_ROOT)) {
fs.copySync(UMD_ROOT, UMD_PKG);
Expand Down
7 changes: 7 additions & 0 deletions src/ajax/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "rxjs/ajax",
"typings": "./index.d.ts",
"main": "./index.js",
"module": "../_esm5/ajax/index.js",
"es2015": "../_esm2015/ajax/index.js"
}
7 changes: 7 additions & 0 deletions src/operators/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "rxjs/operators",
"typings": "./index.d.ts",
"main": "./index.js",
"module": "../_esm5/operators/index.js",
"es2015": "../_esm2015/operators/index.js"
}
7 changes: 7 additions & 0 deletions src/testing/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "rxjs/testing",
"typings": "./index.d.ts",
"main": "./index.js",
"module": "../_esm5/testing/index.js",
"es2015": "../_esm2015/testing/index.js"
}
7 changes: 7 additions & 0 deletions src/websocket/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "rxjs/websocket",
"typings": "./index.d.ts",
"main": "./index.js",
"module": "../_esm5/websocket/index.js",
"es2015": "../_esm2015/websocket/index.js"
}

0 comments on commit 725dcb4

Please sign in to comment.