Skip to content

Commit

Permalink
fix(cli/site): 修改生成umd文件名和库的全局变量名称
Browse files Browse the repository at this point in the history
affects: @varlet/cli, @varlet/ui
  • Loading branch information
haoziqaq committed Apr 6, 2021
1 parent 0f475a6 commit ac39eb0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/varlet-cli/site/site.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,5 +333,6 @@
"description": "Varlet 组件库示例",
"logo": "https://cn.vuejs.org/images/logo.png",
"redirect": "/home"
}
},
"name": "Varlet"
}
7 changes: 3 additions & 4 deletions packages/varlet-cli/src/config/webpack.umd.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
1 change: 1 addition & 0 deletions packages/varlet-ui/varlet.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
name: 'Varlet',
namespace: 'var',
title: 'Varlet',
host: '0.0.0.0',
Expand Down

0 comments on commit ac39eb0

Please sign in to comment.