File tree 4 files changed +22
-5
lines changed 4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change
1
+ .editorconfig
2
+ .babelrc
3
+ .eslintrc.js
4
+ .gitignore
5
+ webpack.config.js
6
+ node_modules /
Original file line number Diff line number Diff line change 17
17
"start" : " webpack --watch" ,
18
18
"build" : " webpack" ,
19
19
"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"
21
22
},
22
23
"repository" : {
23
24
"type" : " git" ,
Original file line number Diff line number Diff line change 1
- // eslint-disable-next-line dependencies/no-unresolved
2
1
import React , { Component } from 'react'
3
2
import PropTypes from 'prop-types'
4
3
Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' )
2
2
const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' ) . BundleAnalyzerPlugin
3
3
const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' )
4
+ const pkg = require ( './package.json' )
4
5
5
6
module . exports = {
6
7
mode : 'production' ,
@@ -9,7 +10,7 @@ module.exports = {
9
10
path : path . resolve ( __dirname , 'dist' ) ,
10
11
filename : 'index.js' ,
11
12
libraryTarget : 'commonjs2' ,
12
- library : 'react-recaptcha-v3'
13
+ library : pkg . name
13
14
} ,
14
15
module : {
15
16
rules : [
@@ -40,7 +41,17 @@ module.exports = {
40
41
} )
41
42
] ,
42
43
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
+ }
45
56
}
46
57
}
You can’t perform that action at this time.
0 commit comments