Skip to content

Commit b44d033

Browse files
update rollup (#133)
1 parent 9034ce5 commit b44d033

File tree

9 files changed

+55
-78
lines changed

9 files changed

+55
-78
lines changed

src/feature-management-applicationinsights-browser/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
"description": "Feature Management Application Insights Plugin for Browser provides a solution for sending feature flag evaluation events produced by the Feature Management library.",
55
"main": "./dist/esm/index.js",
66
"type": "module",
7-
"types": "types/index.d.ts",
7+
"types": "./dist/types/index.d.ts",
88
"files": [
99
"dist/",
10-
"types/",
1110
"LICENSE",
1211
"README.md"
1312
],
1413
"scripts": {
1514
"build": "npm run link && npm run clean && rollup --config",
16-
"clean": "rimraf dist types",
15+
"clean": "rimraf dist",
1716
"link": "npm link ../feature-management",
1817
"dev": "rollup --config --watch",
1918
"lint": "eslint src/",

src/feature-management-applicationinsights-browser/rollup.config.mjs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,14 @@ export default [
1616
],
1717
plugins: [
1818
typescript({
19-
compilerOptions: {
20-
"lib": [
21-
"DOM",
22-
"WebWorker",
23-
"ESNext"
24-
],
25-
"skipDefaultLibCheck": true,
26-
"module": "NodeNext",
27-
"moduleResolution": "NodeNext",
28-
"target": "ES2022",
29-
"strictNullChecks": true,
30-
"strictFunctionTypes": true,
31-
"sourceMap": true,
32-
"inlineSources": true
33-
}
19+
tsconfig: "./tsconfig.json",
3420
})
3521
],
3622
},
3723
{
3824
external: ["@microsoft/feature-management"],
3925
input: "src/index.ts",
40-
output: [{ file: "types/index.d.ts", format: "esm" }],
26+
output: [{ file: "dist/types/index.d.ts", format: "esm" }],
4127
plugins: [dts()],
4228
}
4329
];

src/feature-management-applicationinsights-browser/tsconfig.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
{
22
"compilerOptions": {
3+
// Include ES2022 (modern JS), ESNext (future features), DOM and web worker APIs for browser support.
34
"lib": [
45
"DOM",
56
"WebWorker",
67
"ESNext",
78
"ES2022"
89
],
9-
"skipDefaultLibCheck": true,
10-
"module": "ESNext",
11-
"moduleResolution": "Node",
10+
// Generate modern JavaScript syntax compatible with modern browsers.
1211
"target": "ES2022",
12+
13+
// Use Node-style resolution to locate imports
14+
"moduleResolution": "Node",
15+
16+
// Ensure strict type-checking
1317
"strictNullChecks": true,
1418
"strictFunctionTypes": true,
19+
"skipDefaultLibCheck": true,
20+
21+
// Generate source maps and inline original TypeScript sources for debugging.
1522
"sourceMap": true,
1623
"inlineSources": true,
17-
"allowSyntheticDefaultImports": true,
18-
"esModuleInterop": true
1924
},
2025
"exclude": [
2126
"node_modules",

src/feature-management-applicationinsights-node/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@
44
"description": "Feature Management Application Insights Plugin for Node.js provides a solution for sending feature flag evaluation events produced by the Feature Management library.",
55
"files": [
66
"dist/",
7-
"types/",
87
"LICENSE",
98
"README.md"
109
],
1110
"exports": {
1211
"./package.json": "./package.json",
1312
".": {
1413
"import": {
15-
"types": "./types/index.d.ts",
14+
"types": "./dist/types/index.d.ts",
1615
"default": "./dist/esm/index.js"
1716
},
1817
"require": {
19-
"types": "./types/index.d.ts",
18+
"types": "./dist/types/index.d.ts",
2019
"default": "./dist/commonjs/index.js"
2120
}
2221
}
2322
},
2423
"scripts": {
2524
"build": "npm run link && npm run clean && rollup --config",
26-
"clean": "rimraf dist types",
25+
"clean": "rimraf dist",
2726
"link": "npm link ../feature-management",
2827
"dev": "rollup --config --watch",
2928
"lint": "eslint src/",

src/feature-management-applicationinsights-node/rollup.config.mjs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,14 @@ export default [
2222
],
2323
plugins: [
2424
typescript({
25-
compilerOptions: {
26-
"lib": [
27-
"DOM",
28-
"WebWorker",
29-
"ESNext"
30-
],
31-
"skipDefaultLibCheck": true,
32-
"module": "NodeNext",
33-
"moduleResolution": "NodeNext",
34-
"target": "ES2022",
35-
"strictNullChecks": true,
36-
"strictFunctionTypes": true,
37-
"sourceMap": true,
38-
"inlineSources": true
39-
}
25+
tsconfig: "./tsconfig.json",
4026
})
4127
],
4228
},
4329
{
4430
external: ["@microsoft/feature-management"],
4531
input: "src/index.ts",
46-
output: [{ file: "types/index.d.ts", format: "esm" }],
32+
output: [{ file: "dist/types/index.d.ts", format: "esm" }],
4733
plugins: [dts()],
4834
}
4935
];

src/feature-management-applicationinsights-node/tsconfig.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
{
22
"compilerOptions": {
3+
// Include ES2022 (modern JS), ESNext (future features) and web worker APIs.
34
"lib": [
4-
"DOM",
55
"WebWorker",
66
"ESNext",
77
"ES2022"
88
],
9-
"skipDefaultLibCheck": true,
10-
"module": "ESNext",
11-
"moduleResolution": "Node",
9+
// Generate modern JavaScript syntax compatible with Node 18+.
1210
"target": "ES2022",
11+
12+
// Use Node-style resolution to locate imports
13+
"moduleResolution": "Node",
14+
15+
// Allow default imports from CommonJS modules.
16+
"allowSyntheticDefaultImports": true,
17+
"esModuleInterop": true,
18+
19+
// Ensure strict type-checking
1320
"strictNullChecks": true,
1421
"strictFunctionTypes": true,
22+
"skipDefaultLibCheck": true,
23+
24+
// Generate source maps and inline original TypeScript sources for debugging.
1525
"sourceMap": true,
1626
"inlineSources": true,
17-
"allowSyntheticDefaultImports": true,
18-
"esModuleInterop": true
1927
},
2028
"exclude": [
2129
"node_modules",

src/feature-management/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44
"description": "Feature Management is a library for enabling/disabling features at runtime. Developers can use feature flags in simple use cases like conditional statement to more advanced scenarios like conditionally adding routes.",
55
"files": [
66
"dist/",
7-
"types/",
87
"LICENSE",
98
"README.md"
109
],
1110
"exports": {
1211
"./package.json": "./package.json",
1312
".": {
1413
"import": {
15-
"types": "./types/index.d.ts",
14+
"types": "./dist/types/index.d.ts",
1615
"default": "./dist/esm/index.js"
1716
},
1817
"require": {
19-
"types": "./types/index.d.ts",
18+
"types": "./dist/types/index.d.ts",
2019
"default": "./dist/commonjs/index.js"
2120
}
2221
}
@@ -26,7 +25,7 @@
2625
"build-test": "npm run build-test-esm && npm run build-test-cjs",
2726
"build-test-esm": "tsc -p ./tsconfig.test.esm.json && cpy esm-package.json out/esm --rename=package.json",
2827
"build-test-cjs": "tsc -p ./tsconfig.test.cjs.json && cpy cjs-package.json out/commonjs --rename=package.json",
29-
"clean": "rimraf dist out types",
28+
"clean": "rimraf dist out",
3029
"dev": "rollup --config --watch",
3130
"lint": "eslint src/ test/ --ignore-pattern test/browser/testcases.js",
3231
"fix-lint": "eslint src/ test/ --fix --ignore-pattern test/browser/testcases.js",

src/feature-management/rollup.config.mjs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import dts from "rollup-plugin-dts";
44

55
export default [
66
{
7-
external: ["crypto"],
7+
external: [
8+
"crypto"
9+
],
810
input: "src/index.ts",
911
output: [
1012
{
@@ -28,30 +30,13 @@ export default [
2830
],
2931
plugins: [
3032
typescript({
31-
compilerOptions: {
32-
"lib": [
33-
"DOM",
34-
"WebWorker",
35-
"ESNext"
36-
],
37-
"skipDefaultLibCheck": true,
38-
"module": "ESNext",
39-
"moduleResolution": "Node",
40-
"target": "ES2022",
41-
"strictNullChecks": true,
42-
"strictFunctionTypes": true,
43-
"sourceMap": true,
44-
"inlineSources": true
45-
},
46-
"exclude": [
47-
"test/**/*"
48-
]
33+
tsconfig: "./tsconfig.json",
4934
})
5035
],
5136
},
5237
{
5338
input: "src/index.ts",
54-
output: [{ file: "types/index.d.ts", format: "esm" }],
39+
output: [{ file: "dist/types/index.d.ts", format: "esm" }],
5540
plugins: [dts()],
5641
},
5742
];

src/feature-management/tsconfig.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
{
22
"compilerOptions": {
3+
// Include ES2022 (modern JS), ESNext (future features), DOM and web worker APIs for browser support.
34
"lib": [
45
"DOM",
56
"WebWorker",
67
"ESNext",
78
"ES2022"
89
],
9-
"skipDefaultLibCheck": true,
10-
"moduleResolution": "Node",
10+
// Generate modern JavaScript syntax compatible with Node 18+ and modern browsers.
1111
"target": "ES2022",
12+
13+
// Use Node-style resolution to locate imports
14+
"moduleResolution": "Node",
15+
16+
// Allow default imports from CommonJS modules.
17+
"allowSyntheticDefaultImports": true,
18+
"esModuleInterop": true,
19+
20+
// Ensure strict type-checking
1221
"strictNullChecks": true,
1322
"strictFunctionTypes": true,
23+
"skipDefaultLibCheck": true,
24+
25+
// Generate source maps and inline original TypeScript sources for debugging.
1426
"sourceMap": true,
1527
"inlineSources": true,
16-
"allowSyntheticDefaultImports": true,
17-
"esModuleInterop": true
1828
},
1929
"exclude": [
2030
"node_modules",

0 commit comments

Comments
 (0)