Skip to content

Commit 539b670

Browse files
committed
feat: include type declaration file into package
fixes #217
1 parent ce2e84a commit 539b670

File tree

3 files changed

+234
-13
lines changed

3 files changed

+234
-13
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "react-optimize",
33
"version": "1.0.2",
44
"main": "lib/react-optimize.js",
5+
"types": "lib/react-optimize.d.ts",
56
"repository": "hudovisk/react-optimize",
67
"license": "MIT",
78
"files": [
@@ -36,6 +37,7 @@
3637
"babel-eslint": "^10.1.0",
3738
"babel-loader": "^8.1.0",
3839
"chai": "^4.2.0",
40+
"copy-webpack-plugin": "^6.2.1",
3941
"cross-env": "^7.0.2",
4042
"enzyme": "^3.11.0",
4143
"enzyme-adapter-react-16": "^1.15.5",

webpack.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const path = require("path");
2+
const CopyPlugin = require("copy-webpack-plugin");
23

34
module.exports = {
45
mode: process.env.NODE_ENV === "production" ? "production" : "development",
@@ -25,5 +26,15 @@ module.exports = {
2526
}
2627
}
2728
]
28-
}
29+
},
30+
plugins: [
31+
new CopyPlugin({
32+
patterns: [
33+
{
34+
from: path.join(__dirname, "src/index.d.ts"),
35+
to: path.join(__dirname, 'lib', 'react-optimize.d.ts'),
36+
}
37+
]
38+
})
39+
]
2940
};

0 commit comments

Comments
 (0)