Skip to content

Commit 12f2d24

Browse files
committed
add .npmignore, cleanup
1 parent 5288495 commit 12f2d24

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.editorconfig
2+
.babelrc
3+
.eslintrc.js
4+
.gitignore
5+
webpack.config.js
6+
node_modules/

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"start": "webpack --watch",
1818
"build": "webpack",
1919
"lint": "npx eslint ./src",
20-
"clean": "rm -rf ./package-lock.json ./node_modules/"
20+
"clean": "rm -rf ./package-lock.json ./node_modules/",
21+
"prepublish": "rm -rf ./dist && npm run build"
2122
},
2223
"repository": {
2324
"type": "git",

src/ReCaptcha.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line dependencies/no-unresolved
21
import React, { Component } from 'react'
32
import PropTypes from 'prop-types'
43

webpack.config.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path')
22
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
33
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
4+
const pkg = require('./package.json')
45

56
module.exports = {
67
mode: 'production',
@@ -9,7 +10,7 @@ module.exports = {
910
path: path.resolve(__dirname, 'dist'),
1011
filename: 'index.js',
1112
libraryTarget: 'commonjs2',
12-
library: 'react-recaptcha-v3'
13+
library: pkg.name
1314
},
1415
module: {
1516
rules: [
@@ -40,7 +41,17 @@ module.exports = {
4041
})
4142
],
4243
externals: {
43-
'react': 'commonjs react',
44-
'prop-types': 'commonjs prop-types' // this line is just to use the React dependency of our parent-testing-project instead of using our own React.
44+
'react': {
45+
commonjs: 'react',
46+
commonjs2: 'react',
47+
amd: 'React',
48+
root: 'React'
49+
},
50+
'prop-types': {
51+
commonjs: 'prop-types',
52+
commonjs2: 'prop-types',
53+
amd: 'PropTypes',
54+
root: 'PropTypes'
55+
}
4556
}
4657
}

0 commit comments

Comments
 (0)