mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
* storybook environment setup * customized loader * add basic example of BasicTable * add script to bootstrap storybook * import bootstrap css for storybook * update webpack.config for adding loader for font and css * add sass loader and allow to customize css for storybook * uncheck lint for react-bootstrap-table-example * package example has its own lint check * run yarn in each package when boostrapping lerna * add peerDependencies for package example
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
import * as path from 'path';
|
|
import webpack from 'webpack';
|
|
|
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
|
|
const sourcePath = path.join(__dirname, 'packages/react-bootstrap-table2/src');
|
|
const examplePath = path.join(__dirname, 'packages/react-bootstrap-table2-example/src');
|
|
const exampleHTMLPath = path.join(__dirname, 'packages/react-bootstrap-table2-example/src/index.html');
|
|
|
|
module.exports = {
|
|
entry: examplePath,
|
|
devtool: '#eval-source-map',
|
|
devServer: {
|
|
historyApiFallback: true,
|
|
hot: true,
|
|
inline: true,
|
|
// progress: true,
|
|
noInfo: true,
|
|
stats: 'errors-only'
|
|
},
|
|
output: {
|
|
path: path.join(__dirname, 'examples'),
|
|
filename: '[name].bundle.js'
|
|
},
|
|
module: {
|
|
rules: [{
|
|
enforce: 'pre',
|
|
test: /\.js?$/,
|
|
exclude: /node_modules/,
|
|
include: [sourcePath],
|
|
loader: 'eslint-loader'
|
|
}, {
|
|
test: /\.js?$/,
|
|
use: ['babel-loader'],
|
|
exclude: /node_modules/,
|
|
include: [sourcePath, examplePath]
|
|
}, {
|
|
test: /\.css$/,
|
|
use: 'style-loader!css-loader'
|
|
}]
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: exampleHTMLPath
|
|
}),
|
|
new webpack.HotModuleReplacementPlugin()
|
|
]
|
|
};
|