Skip to content

Commit 6f7075d

Browse files
committed
change cpy cli to copy-webpack-plugin
1 parent 2bc62d2 commit 6f7075d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "dist/index.d.ts",
77
"scripts": {
88
"build:dev": "webpack --config webpack.dev.js && webpack-dev-server --open --config webpack.dev.js",
9-
"build:prod": "rm -rf ./dist && webpack --config webpack.prod.js && cpy src/index.d.ts dist/index.d.ts"
9+
"build:prod": "rm -rf ./dist && webpack --config webpack.prod.js"
1010
},
1111
"repository": {
1212
"type": "git",
@@ -41,7 +41,6 @@
4141
"babel-preset-react": "^6.24.1",
4242
"babel-preset-stage-1": "^6.24.1",
4343
"copy-webpack-plugin": "^4.6.0",
44-
"cpy-cli": "^3.0.0",
4544
"react": "^16.8.0",
4645
"react-dom": "16.8.0",
4746
"webpack": "^4.24.0",

webpack.prod.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const CopyWebpackPlugin = require('copy-webpack-plugin');
2+
13
module.exports = {
24
performance: {
35
hints: false
@@ -18,6 +20,11 @@ module.exports = {
1820
}
1921
}]
2022
},
23+
plugins: [
24+
new CopyWebpackPlugin([
25+
{ from: './src/index.d.ts', to: './' },
26+
]),
27+
],
2128
externals: [
2229
'react',
2330
/^react\/.+$/,

0 commit comments

Comments
 (0)