react-bootstrap-table2-example depend other packages via webpack resolver instead of node modules

This commit is contained in:
AllenFang 2018-01-14 18:29:27 +08:00
parent afc742c205
commit 3a8390c49e
14 changed files with 34 additions and 29 deletions

View File

@ -1,10 +1,10 @@
import wrapperFactory from './wrapper';
import editingCellFactory from './editing-cell';
import wrapperFactory from './src/wrapper';
import editingCellFactory from './src/editing-cell';
import {
CLICK_TO_CELL_EDIT,
DBCLICK_TO_CELL_EDIT,
DELAY_FOR_DBCLICK
} from './const';
} from './src/const';
export default (options = {}) => ({
wrapperFactory,

View File

@ -2,7 +2,7 @@
"name": "react-bootstrap-table2-editor",
"version": "0.0.1",
"description": "it's the editor addon for react-bootstrap-table2",
"main": "src/index.js",
"main": "./dist/react-bootstrap-table2-editor.min.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},

View File

@ -0,0 +1,3 @@
{
"presets": ["react", "es2015", "stage-0", ["env", {"modules": false} ]]
}

View File

@ -1,10 +1,10 @@
const path = require('path');
const sourcePath = path.join(__dirname, '../../react-bootstrap-table2/src');
const paginationSourcePath = path.join(__dirname, '../../react-bootstrap-table2-paginator/src');
const overlaySourcePath = path.join(__dirname, '../../react-bootstrap-table2-overlay/src');
const filterSourcePath = path.join(__dirname, '../../react-bootstrap-table2-filter/src');
const editorSourcePath = path.join(__dirname, '../../react-bootstrap-table2-editor/src');
const sourcePath = path.join(__dirname, '../../react-bootstrap-table2');
const paginationSourcePath = path.join(__dirname, '../../react-bootstrap-table2-paginator');
const overlaySourcePath = path.join(__dirname, '../../react-bootstrap-table2-overlay');
const filterSourcePath = path.join(__dirname, '../../react-bootstrap-table2-filter');
const editorSourcePath = path.join(__dirname, '../../react-bootstrap-table2-editor');
const sourceStylePath = path.join(__dirname, '../../react-bootstrap-table2/style');
const paginationStylePath = path.join(__dirname, '../../react-bootstrap-table2-paginator/style');
const storyPath = path.join(__dirname, '../stories');
@ -16,6 +16,12 @@ const aliasPath = {
src: srcPath,
components: path.join(srcPath, 'components'),
utils: path.join(srcPath, 'utils'),
'react-bootstrap-table2': sourcePath,
'react-bootstrap-table2-editor': editorSourcePath,
'react-bootstrap-table2-filter': filterSourcePath,
'react-bootstrap-table2-overlay': overlaySourcePath,
'react-bootstrap-table2-paginator': paginationSourcePath,
};
const loaders = [{
@ -28,7 +34,7 @@ const loaders = [{
test: /\.js?$/,
use: ['babel-loader'],
exclude: /node_modules/,
include: [sourcePath, paginationSourcePath, overlaySourcePath, filterSourcePath, editorSourcePath, storyPath],
include: [sourcePath, paginationSourcePath, overlaySourcePath, filterSourcePath, editorSourcePath, storyPath]
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader'],

View File

@ -18,16 +18,12 @@
"react-dom": "^15.0.0"
},
"dependencies": {
"bootstrap": "^3.3.7",
"react-bootstrap-table2": "0.0.1",
"react-bootstrap-table2-editor": "0.0.1",
"react-bootstrap-table2-paginator": "0.0.1",
"react-bootstrap-table2-overlay": "0.0.1",
"react-bootstrap-table2-filter": "0.0.1"
"bootstrap": "^3.3.7"
},
"devDependencies": {
"@storybook/addon-console": "^1.0.0",
"@storybook/react": "^3.2.8",
"babel-preset-env": "^1.6.1",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",

View File

@ -1,6 +1,6 @@
import TextFilter from './components/text';
import wrapperFactory from './wrapper';
import * as Comparison from './comparison';
import TextFilter from './src/components/text';
import wrapperFactory from './src/wrapper';
import * as Comparison from './src/comparison';
export default (options = {}) => ({
wrapperFactory,

View File

@ -2,7 +2,7 @@
"name": "react-bootstrap-table2-filter",
"version": "0.0.1",
"description": "it's the column filter addon for react-bootstrap-table2",
"main": "./lib",
"main": "./dist/react-bootstrap-table2-filter.min.js",
"author": "",
"license": "ISC"
}

View File

@ -2,7 +2,7 @@
"name": "react-bootstrap-table2-overlay",
"version": "0.0.1",
"description": "it's a loading overlay component for react-bootstrap-table2",
"main": "./lib",
"main": "./dist/react-bootstrap-table2-overlay.min.js",
"author": "",
"license": "ISC",
"dependencies": {

View File

@ -1,4 +1,4 @@
import wrapperFactory from './wrapper';
import wrapperFactory from './src/wrapper';
export default (options = {}) => ({
wrapperFactory,

View File

@ -2,7 +2,7 @@
"name": "react-bootstrap-table2-paginator",
"version": "0.0.1",
"description": "it's the pagination addon for react-bootstrap-table2",
"main": "./lib",
"main": "./dist/react-bootstrap-table2-paginator.min.js",
"author": "",
"license": "ISC"
}

View File

@ -0,0 +1,5 @@
import BootstrapTable from './src/bootstrap-table';
import withDataStore from './src/container';
export default withDataStore(BootstrapTable);

View File

@ -2,7 +2,7 @@
"name": "react-bootstrap-table2",
"version": "0.0.1",
"description": "Rebuilt for react-bootstrap-table",
"main": "./lib",
"main": "./dist/react-bootstrap-table2.min.js",
"author": "",
"license": "ISC"
}

View File

@ -1,5 +0,0 @@
import BootstrapTable from './bootstrap-table';
import withDataStore from './container';
export default withDataStore(BootstrapTable);