Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.

Commit d30eb3b

Browse files
authored
Merge pull request #1 from surol/es6-main
es6 main module
2 parents 1c24694 + fee9210 commit d30eb3b

File tree

6 files changed

+108
-101
lines changed

6 files changed

+108
-101
lines changed

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "context-values",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "IoC context values provider",
55
"keywords": [
66
"ioc"
@@ -15,35 +15,36 @@
1515
"bugs": {
1616
"url": "https://github.com/surol/context-values/issues"
1717
},
18-
"main": "dist/context-values.umd.js",
19-
"module": "dist/context-values.esm5.js",
20-
"es2015": "dist/context-values.esm2015.js",
18+
"main": "dist/context-values.js",
19+
"browser": "dist/context-values.umd.js",
20+
"module": "dist/context-values.mjs",
21+
"esm5": "dist/context-values.esm5.js",
2122
"typings": "index.d.ts",
2223
"dependencies": {
2324
"tslib": "^1.9.0"
2425
},
2526
"peerDependencies": {
26-
"a-iterable": "^2.0.0",
27-
"call-thru": "^2.0.0"
27+
"a-iterable": "^2.1.0",
28+
"call-thru": "^2.1.0"
2829
},
2930
"devDependencies": {
3031
"@types/fs-extra": "^5.0.4",
3132
"@types/jest": "^23.3.10",
32-
"a-iterable": "^2.0.1",
33-
"call-thru": "^2.0.0",
33+
"a-iterable": "^2.1.0",
34+
"call-thru": "^2.1.0",
3435
"codecov": "^3.1.0",
3536
"fs-extra": "^7.0.1",
3637
"jest": "^23.6.0",
3738
"jest-junit": "^5.2.0",
38-
"rollup": "^0.67.4",
39+
"rollup": "^0.68.1",
3940
"rollup-plugin-commonjs": "^9.2.0",
40-
"rollup-plugin-node-resolve": "^3.4.0",
41+
"rollup-plugin-node-resolve": "^4.0.0",
4142
"rollup-plugin-sourcemaps": "^0.4.2",
4243
"rollup-plugin-terser": "^3.0.0",
43-
"rollup-plugin-typescript2": "^0.18.0",
44+
"rollup-plugin-typescript2": "^0.18.1",
4445
"rollup-plugin-uglify": "^6.0.0",
4546
"ts-jest": "^23.10.5",
46-
"tslint": "^5.11.0",
47+
"tslint": "^5.12.0",
4748
"typescript": "^3.2.2"
4849
},
4950
"scripts": {

rollup.config.js

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import nodeResolve from "rollup-plugin-node-resolve";
2-
import commonjs from "rollup-plugin-commonjs";
3-
import sourcemaps from "rollup-plugin-sourcemaps";
4-
import { terser } from "rollup-plugin-terser";
5-
import typescript from "rollup-plugin-typescript2";
6-
import { uglify } from "rollup-plugin-uglify";
1+
import nodeResolve from 'rollup-plugin-node-resolve';
2+
import commonjs from 'rollup-plugin-commonjs';
3+
import sourcemaps from 'rollup-plugin-sourcemaps';
4+
import { terser } from 'rollup-plugin-terser';
5+
import typescript from 'rollup-plugin-typescript2';
6+
import { uglify } from 'rollup-plugin-uglify';
7+
import pkg from './package.json';
78

89
function makeConfig(baseConfig, ...configs) {
910
return configs.reduce(
@@ -74,37 +75,47 @@ function baseConfig(tsconfig) {
7475
};
7576
}
7677

78+
const mainConfig = makeConfig(
79+
baseConfig('tsconfig.main.json'),
80+
{
81+
output: {
82+
file: pkg.main,
83+
},
84+
},
85+
terserConfig);
86+
7787
const umdConfig = makeConfig(
78-
baseConfig("tsconfig.umd.json"),
88+
baseConfig('tsconfig.umd.json'),
7989
{
8090
output: {
81-
file: './dist/context-values.umd.js',
91+
file: pkg.browser,
8292
},
8393
},
8494
uglifyConfig);
8595

86-
const esm5Config = makeConfig(
87-
baseConfig("tsconfig.esm5.json"),
96+
const esmConfig = makeConfig(
97+
baseConfig('tsconfig.esm.json'),
8898
{
8999
output: {
90-
format: "esm",
91-
file: "./dist/context-values.esm5.js",
100+
format: 'esm',
101+
file: pkg.module,
92102
},
93103
},
94104
terserConfig);
95105

96-
const esm2015Config = makeConfig(
97-
baseConfig("tsconfig.esm2015.json"),
106+
const esm5Config = makeConfig(
107+
baseConfig('tsconfig.umd.json'),
98108
{
99109
output: {
100-
format: "esm",
101-
file: "./dist/context-values.esm2015.js",
110+
format: 'esm',
111+
file: pkg.esm5,
102112
},
103113
},
104114
terserConfig);
105115

106116
export default [
117+
mainConfig,
107118
umdConfig,
119+
esmConfig,
108120
esm5Config,
109-
esm2015Config,
110121
]
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
2-
"extends": "./tsconfig.json",
2+
"extends": "./tsconfig.main.json",
33
"compilerOptions": {
44
"declaration": true,
55
"declarationDir": "d.ts",
66
"stripInternal": true
7-
},
8-
"exclude": [
9-
"src/**/*.spec.ts",
10-
"src/spec/**/*"
11-
]
7+
}
128
}

tsconfig.esm5.json renamed to tsconfig.main.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
22
"extends": "./tsconfig.json",
3-
"compilerOptions": {
4-
"target": "es5",
5-
"downlevelIteration": true
6-
},
73
"exclude": [
84
"src/**/*.spec.ts",
95
"src/spec/**/*"

tsconfig.umd.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
2-
"extends": "./tsconfig.json",
2+
"extends": "./tsconfig.main.json",
33
"compilerOptions": {
44
"target": "es5",
55
"downlevelIteration": true
6-
},
7-
"exclude": [
8-
"src/**/*.spec.ts",
9-
"src/spec/**/*"
10-
]
6+
}
117
}

0 commit comments

Comments
 (0)