UNPKG

@wgoo/cli

Version:

Wgoo Cli 是一个 React 组件库构建工具,通过 Wgoo Cli 可以快速搭建一套功能完备的 React 组件库。

31 lines (27 loc) 926 B
const get = require('lodash.get'); const { merge } = require('webpack-merge'); const { getWgooConfig, getWebpackConfig } = require('../common'); const { getSiteDevBaseConfig } = require('./webpack.site.dev'); const { SITE_DIST_DIR } = require('../common/constant'); const wgooConfig = getWgooConfig(); const outputDir = get(wgooConfig, 'build.site.outputDir', SITE_DIST_DIR); const publicPath = get(wgooConfig, 'build.site.publicPath', '/'); function getSitePrdConfig() { return getWebpackConfig( merge(getSiteDevBaseConfig(), { mode: 'production', stats: 'none', performance: { maxAssetSize: 5 * 1024 * 1024, maxEntrypointSize: 5 * 1024 * 1024, }, output: { publicPath, path: outputDir, filename: '[name].[contenthash:8].js', chunkFilename: 'async_[name].[contenthash:8].js', }, }) ); } module.exports = { getSitePrdConfig };