UNPKG

@mypaas/hcm-cli

Version:

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

34 lines (33 loc) 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPackageConfig = void 0; const webpack_merge_1 = require("webpack-merge"); const path_1 = require("path"); const webpack_base_1 = require("./webpack.base"); const common_1 = require("../common"); const constant_1 = require("../common/constant"); function getPackageConfig(isMinify) { common_1.setBuildTarget('package'); return common_1.getWebpackConfig(webpack_merge_1.merge(webpack_base_1.genBaseConfig({ extractCss: true }), { mode: 'production', entry: { index: path_1.join(constant_1.MODULE_DIR, 'entry.js'), }, stats: 'none', output: { path: path_1.join(constant_1.MODULE_DIR, process.env.POSTCSS_REM === 'on' ? 'rem' : 'off-rem'), filename: 'index.js', }, externals(context, request, callback) { if (/^(vue)$/i.test(request)) { return callback(null, `commonjs2 ${request}`); } callback(); }, performance: false, optimization: { minimize: isMinify, }, })); } exports.getPackageConfig = getPackageConfig;