Skip to content

Commit

Permalink
Use esm instead of creating multiple bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Mar 12, 2019
1 parent ce5f224 commit abb1680
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 100 deletions.
1 change: 1 addition & 0 deletions packages/core/cjs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('esm')(module)('../dist/index.js');
9 changes: 6 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"homepage": "https://graphql-modules.com/",
"license": "MIT",
"scripts": {
"clean": "rm -rf dist",
"prebuild": "yarn clean",
"build": "tsc",
"test": "jest",
"build": "tsc && tsc -p tsconfig.es2015.json",
"lint": "tslint -c ../../tslint.json 'src/**/*.ts' --format stylish"
},
"jest": {
Expand All @@ -29,6 +31,7 @@
]
},
"dependencies": {
"esm":"3.2.16",
"@graphql-modules/di": "0.4.2",
"graphql-toolkit": "0.0.5",
"graphql-tools": "4.0.4",
Expand All @@ -43,8 +46,8 @@
"tslint": "5.12.1",
"typescript": "3.3.3"
},
"main": "dist/index.js",
"module": "dist/es2015/index.js",
"main": "cjs/index.js",
"module": "dist/index.js",
"typings": "./dist/index.d.ts",
"typescript": {
"definition": "./dist/index.d.ts"
Expand Down
29 changes: 0 additions & 29 deletions packages/core/tsconfig.es2015.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"module": "commonjs",
"module": "esnext",
"target": "es2018",
"lib": [
"es2018",
Expand Down
1 change: 1 addition & 0 deletions packages/di/cjs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('esm')(module)('../dist/index.js');
8 changes: 5 additions & 3 deletions packages/di/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"homepage": "https://graphql-modules.com/",
"license": "MIT",
"scripts": {
"clean": "rm -rf dist",
"prebuild": "yarn clean",
"build": "tsc",
"test": "jest",
"build": "tsc && tsc -p tsconfig.es2015.json",
"lint": "tslint -c ../../tslint.json 'src/**/*.ts' --format stylish"
},
"jest": {
Expand Down Expand Up @@ -44,8 +46,8 @@
"dependencies": {
"tslib": "1.9.3"
},
"main": "dist/index.js",
"module": "dist/es2015/index.js",
"main": "cjs/index.js",
"module": "dist/index.js",
"typings": "./dist/index.d.ts",
"typescript": {
"definition": "./dist/index.d.ts"
Expand Down
30 changes: 0 additions & 30 deletions packages/di/tsconfig.es2015.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/di/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"module": "commonjs",
"module": "esnext",
"target": "es2018",
"lib": [
"es2018",
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-modules/cjs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('esm')(module)('../dist/index.js');
8 changes: 5 additions & 3 deletions packages/graphql-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"homepage": "https://graphql-modules.com/",
"license": "MIT",
"scripts": {
"clean": "rm -rf dist",
"prebuild": "yarn clean",
"build": "tsc",
"test": "jest",
"build": "tsc && tsc -p tsconfig.es2015.json",
"lint": "tslint -c ../../tslint.json 'src/**/*.ts' --format stylish"
},
"jest": {
Expand Down Expand Up @@ -41,8 +43,8 @@
"@graphql-modules/core": "0.4.2",
"tslib": "1.9.3"
},
"main": "dist/index.js",
"module": "dist/es2015/index.js",
"main": "cjs/index.js",
"module": "dist/index.js",
"typings": "./dist/index.d.ts",
"typescript": {
"definition": "./dist/index.d.ts"
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-modules/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from '@graphql-modules/core';
export * from '@graphql-modules/di';
29 changes: 0 additions & 29 deletions packages/graphql-modules/tsconfig.es2015.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/graphql-modules/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"module": "commonjs",
"module": "esnext",
"target": "es2018",
"lib": [
"es2018",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,11 @@ escodegen@^1.6.1, escodegen@^1.9.1:
optionalDependencies:
source-map "~0.6.1"

[email protected]:
version "3.2.16"
resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.16.tgz#e48f887c29a4a981a4da0baa2ae2bf20e30b5614"
integrity sha512-iACZMQvYFc66Y7QC+vD3oGA/fFsPA/IQwewRJ3K0gbMV52E59pdko02kF2TfVdtp5aHO62PHxL6fxtHJmhm3NQ==

esprima@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
Expand Down

0 comments on commit abb1680

Please sign in to comment.