Skip to content

Commit a8948ae

Browse files
committed
Make the examples use an alias import
Should make the examples align more with what a developer would typically invoke.
1 parent ce67ed0 commit a8948ae

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,12 @@
1616
"env": {
1717
"browser": true,
1818
"mocha": true
19+
},
20+
"settings": {
21+
"import/resolver": {
22+
"webpack": {
23+
"config": "webpack.test.config.js"
24+
}
25+
}
1926
}
2027
}

examples/src/js/BasicExample.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
2-
3-
import CheckboxTree from '../../../src/index';
2+
import CheckboxTree from 'react-checkbox-tree';
43

54
const nodes = [
65
{

examples/src/js/CustomIconsExample.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
2-
3-
import CheckboxTree from '../../../src/index';
2+
import CheckboxTree from 'react-checkbox-tree';
43

54
const nodes = [
65
{

examples/src/js/PessimisticToggleExample.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
2-
3-
import CheckboxTree from '../../../src/index';
2+
import CheckboxTree from 'react-checkbox-tree';
43

54
const nodes = [
65
{

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"enzyme": "^2.7.1",
3737
"eslint": "^3.15.0",
3838
"eslint-config-airbnb": "^14.1.0",
39+
"eslint-import-resolver-webpack": "^0.8.1",
3940
"eslint-plugin-import": "^2.2.0",
4041
"eslint-plugin-jsx-a11y": "^4.0.0",
4142
"eslint-plugin-react": "^6.9.0",

webpack.test.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
const path = require('path');
2+
13
module.exports = {
24
output: {
35
filename: 'index.js',
46
libraryTarget: 'umd',
57
library: 'ReactCheckboxTree',
68
},
9+
resolve: {
10+
alias: {
11+
'react-checkbox-tree': path.resolve(__dirname, 'src/js/CheckboxTree'),
12+
},
13+
},
714
module: {
815
rules: [
916
{

0 commit comments

Comments
 (0)