diff --git a/packages/varlet-cli/site/site.config.json b/packages/varlet-cli/site/site.config.json index 9b91751dc55..88c58ce0694 100644 --- a/packages/varlet-cli/site/site.config.json +++ b/packages/varlet-cli/site/site.config.json @@ -333,5 +333,6 @@ "description": "Varlet 组件库示例", "logo": "https://cn.vuejs.org/images/logo.png", "redirect": "/home" - } + }, + "name": "Varlet" } \ No newline at end of file diff --git a/packages/varlet-cli/src/config/webpack.umd.config.ts b/packages/varlet-cli/src/config/webpack.umd.config.ts index a9c837e6733..f438c1bcc23 100644 --- a/packages/varlet-cli/src/config/webpack.umd.config.ts +++ b/packages/varlet-cli/src/config/webpack.umd.config.ts @@ -3,19 +3,18 @@ import { resolve } from 'path' import { BASE_CONFIG } from './webpack.base.config' import { ES_DIR, UMD_DIR } from '../shared/constant' import { varletConfig } from './varlet.config' -import { bigCamelize } from '../shared/fsUtils' import { get } from 'lodash' export function getUmdConfig() { - const namespace = get(varletConfig, 'namespace') + const name: string = get(varletConfig, 'name') return merge(BASE_CONFIG as any, { mode: 'production', entry: resolve(ES_DIR, 'umdIndex.js'), output: { path: UMD_DIR, - filename: `${namespace}.js`, - library: `${bigCamelize(namespace)}`, + filename: `${name.toLocaleLowerCase()}.js`, + library: name, libraryTarget: 'umd', umdNamedDefine: true, }, diff --git a/packages/varlet-ui/varlet.config.js b/packages/varlet-ui/varlet.config.js index 36897fdfb06..90ca52aa448 100644 --- a/packages/varlet-ui/varlet.config.js +++ b/packages/varlet-ui/varlet.config.js @@ -1,4 +1,5 @@ module.exports = { + name: 'Varlet', namespace: 'var', title: 'Varlet', host: '0.0.0.0',