Skip to content

Commit 3097c48

Browse files
committed
Fix build issues for default exports
1 parent b6f0e6b commit 3097c48

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## [v1.7.1](https://github.com/jakezatecky/react-checkbox-tree/compare/v1.7.0...v1.7.1) (2021-06-08)
4+
5+
### Build
6+
7+
* Fix build issues for default exports
8+
39
## [v1.7.0](https://github.com/jakezatecky/react-checkbox-tree/compare/v1.6.0...v1.7.0) (2021-06-08)
410

511
### New Features

src/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
const tree = require('./js/CheckboxTree').default;
2-
const utils = require('./js/utils');
1+
import CheckboxTree from './js/CheckboxTree';
32

4-
module.exports = {
5-
default: tree,
6-
...utils,
7-
};
3+
export default CheckboxTree;
4+
export * from './js/utils';

webpack.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ function makeConfig(target) {
99
target,
1010
output: {
1111
filename: fileMap[target],
12-
libraryTarget: 'umd',
13-
library: 'ReactCheckboxTree',
12+
library: {
13+
name: 'ReactCheckboxTree',
14+
type: 'umd',
15+
},
1416
},
1517
externals: [
1618
{

webpack.test.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ module.exports = {
44
mode: 'development',
55
output: {
66
filename: 'index.js',
7-
libraryTarget: 'umd',
8-
library: 'ReactCheckboxTree',
7+
library: {
8+
name: 'ReactCheckboxTree',
9+
type: 'umd',
10+
},
911
},
1012
resolve: {
1113
alias: {
12-
'react-checkbox-tree': path.resolve(__dirname, 'src/js/CheckboxTree'),
14+
'react-checkbox-tree': path.resolve(__dirname, 'src/index.js'),
1315
},
1416
},
1517
module: {

0 commit comments

Comments
 (0)