1 Star 1 Fork 75

devhxj/rsuite

forked from rsuite/rsuite 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.js 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const webpack = require('webpack');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const __DEV__ = process.env.NODE_ENV === 'development';
const filename = __DEV__ ? '[name].js' : '[name].min.js';
const plugins = [
new LodashModuleReplacementPlugin(),
new webpack.SourceMapDevToolPlugin({
filename: `${filename}.map`
})
];
if (process.env.ANALYZE === 'true') {
plugins.push(new BundleAnalyzerPlugin());
}
module.exports = {
entry: {
rsuite: path.join(__dirname, 'src')
},
output: {
path: path.join(__dirname, 'lib/dist'),
filename,
library: 'rsuite',
libraryTarget: 'umd'
},
externals: {
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom'
}
},
module: {
rules: [
{
test: /\.ts|tsx?$/,
use: ['babel-loader?babelrc'],
exclude: /node_modules/
}
]
},
plugins,
resolve: {
extensions: ['.ts', '.tsx', '.js']
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/devhxj/rsuite.git
git@gitee.com:devhxj/rsuite.git
devhxj
rsuite
rsuite
main

搜索帮助