1 Star 0 Fork 0

jasonzhouu/rsuite-table

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.js 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
simonguo 提交于 2020-03-02 15:15 . Migrate from Flow to Typescript (#127)
const path = require('path');
const webpack = require('webpack');
const HtmlwebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const markdownRenderer = require('react-markdown-reader').renderer;
const { NODE_ENV } = process.env;
const docsPath = NODE_ENV === 'development' ? './assets' : './';
const plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(NODE_ENV)
}),
new HtmlwebpackPlugin({
title: 'RSUITE Table',
filename: 'index.html',
template: 'docs/index.html',
inject: true,
hash: true,
path: docsPath
}),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css'
})
];
module.exports = (env = {}) => {
return {
entry: './docs/index.tsx',
devtool: 'source-map',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json']
},
devServer: {
hot: true,
contentBase: path.resolve(__dirname, ''),
publicPath: '/',
disableHostCheck: true
},
output: {
path: path.resolve(__dirname, 'assets'),
filename: 'bundle.js',
publicPath: './'
},
plugins,
module: {
rules: [
{
test: /\.tsx?$/,
use: ['babel-loader'],
exclude: /node_modules/
},
{
test: /\.(less|css)$/,
use: [
{
loader: MiniCssExtractPlugin.loader
},
'css-loader',
'less-loader?javascriptEnabled=true'
]
},
{
test: /\.md$/,
use: [
{
loader: 'html-loader'
},
{
loader: 'markdown-loader',
options: {
pedantic: true,
renderer: markdownRenderer()
}
}
]
},
{
test: /\.(woff|woff2|eot|ttf|svg)($|\?)/,
use: [
{
loader:
'url-loader?limit=1&hash=sha512&digest=hex&size=16&name=resources/[hash].[ext]'
}
]
}
]
}
};
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jasonzhouu/rsuite-table.git
git@gitee.com:jasonzhouu/rsuite-table.git
jasonzhouu
rsuite-table
rsuite-table
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385