加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
simonguo 提交于 2019-07-31 14:13 . Migrate from flow to typescript (#531)
const path = require('path');
const webpack = require('webpack');
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
const __DEV__ = process.env.NODE_ENV === 'development';
const filename = __DEV__ ? '[name].js' : '[name].min.js';
module.exports = {
entry: {
rsuite: path.join(__dirname, 'src')
},
output: {
path: path.join(__dirname, '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: [
new LodashModuleReplacementPlugin(),
new webpack.SourceMapDevToolPlugin({
filename: `${filename}.map`
})
],
resolve: {
extensions: ['.ts', '.tsx', '.js']
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化