Skip to content

Commit b3b1f89

Browse files
committed
New: exporting scriptloader-support to be used outside of React
1 parent e472016 commit b3b1f89

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = {
5252
},
5353
},
5454
{
55-
files: ["./*.js"],
55+
files: ["./*.js", "./scriptloader-support/*.js"],
5656
env: { node: true },
5757
},
5858
{

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
"version": "1.3.0",
44
"description": "A React Component for reacting to scripts loading.",
55
"main": "dist/index.js",
6-
"types": "dist/index.d.ts",
6+
"exports": {
7+
".": "./dist/index.js",
8+
"./scriptloader-support": "./dist/scriptloader-support/index.js"
9+
},
710
"files": [
8-
"dist"
11+
"dist",
12+
"src",
13+
"scriptloader-support"
914
],
1015
"scripts": {
1116
"test": "eslint --quiet . && tsc --noEmit --project ./tsconfig.json && jest",

scriptloader-support.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

scriptloader-support/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "../src/scriptloader-support";

scriptloader-support/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const exports = require("../dist/src/scriptloader-support");
2+
module.exports = exports;

tsconfig.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
"module": "commonjs",
1212
"moduleResolution": "node",
1313
"target": "ES5",
14-
"typeRoots": ["node_modules/@types"]
14+
"typeRoots": ["node_modules/@types"],
15+
"paths": {
16+
"scriptloader-support/*": ["./src/scriptloader-support/*"]
17+
}
1518
},
16-
"include": [
17-
"src",
18-
"./index.ts",
19-
"./scriptloader-support.ts",
20-
"./jest.config.ts"
21-
]
19+
"include": ["src", "./index.ts", "./jest.config.ts"]
2220
}

0 commit comments

Comments
 (0)