66 Star 327 Fork 69

GVPrsuite / rsuite

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.js 1.29 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({
currying: true
}),
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']
}
};
TypeScript
1
https://gitee.com/rsuite/rsuite.git
git@gitee.com:rsuite/rsuite.git
rsuite
rsuite
rsuite
main

搜索帮助