Skip to content

Commit 0e29899

Browse files
committed
Merge pull request #347 from staminaloops/devTools
Improved build system
2 parents 374ccd7 + 0d36243 commit 0e29899

18 files changed

+1303
-1325
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ node_modules
55
*.sublime-workspace
66
*.idea
77
*.iml
8+
lib/
9+
npm-debug.log

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ node_modules
55
*.sublime-workspace
66
*.idea
77
*.iml
8+
jsonOutputWebpack.json
89

910
# generated

README.md

+21-4
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,24 @@ npm install react-bootstrap-table --save
5757
```
5858

5959
### b.Import Module
60-
Use react-bootstrap-table in your react app, you should import this component as first. About importing this component, there'r two way in the following you can choose:
61-
##### Module(CommonJS/AMD)
60+
To use react-bootstrap-table in your react app, you should import it first.
61+
You can do this in two ways:
62+
63+
##### With a module bundler
64+
With a module bundler like [webpack](https://webpack.github.io/) that supports either CommonJS or ES2015 modules, use as you would anything else.
65+
You can include source maps on your build system to debug on development. Don't forget to Uglify on production.
66+
6267
```js
63-
import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table'; // in ECMAScript 6
68+
// in ECMAScript 6
69+
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
6470
// or in ECMAScript 5
65-
var ReactBSTable = require("react-bootstrap-table");
71+
var ReactBSTable = require('react-bootstrap-table');
6672
var BootstrapTable = ReactBSTable.BootstrapTable;
6773
var TableHeaderColumn = ReactBSTable.TableHeaderColumn;
6874
```
6975
##### Browser global(window object)
76+
In the `dist` folder you have a UMD bundle with source maps (`react-bootstrap-table.js`) as well as a minified version (`react-bootstrap-table.min.js`).
77+
7078
```html
7179
<script src="path/to/react-bootstrap-table/dist/react-bootstrap-table.min.js" />
7280
<script>
@@ -75,6 +83,15 @@ var TableHeaderColumn = ReactBSTable.TableHeaderColumn;
7583
<script/>
7684
```
7785
86+
The UMD build is also available on [npmcdn](https://npmcdn.com):
87+
88+
```html
89+
// source maps: https://npmcdn.com/react-bootstrap-table/dist/react-bootstrap-table.js.map
90+
<script src="https://npmcdn.com/react-bootstrap-table/dist/react-bootstrap-table.js"></script>
91+
// or use the min version
92+
<script src="https://npmcdn.com/react-bootstrap-table/dist/react-bootstrap-table.min.js"></script>
93+
```
94+
7895
### c.Import CSS
7996
Finally, you need to import the css file to your app, there are two css file you can choose.</br>
8097
```react-bootstrap-table-all.min.css``` include toastr.</br>```react-bootstrap-table.min.css``` doesn't include toastr.</br>

0 commit comments

Comments
 (0)