yks-element 1.2.7 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/bin/pack.js CHANGED
@@ -15,8 +15,9 @@ const NPM_APP_DEV_URL = 'https://gldev.cetset.com'
15
15
  const NPM_APP_TEST_URL = 'https://gltest.cetset.com'
16
16
  const NPM_APP_PRE_URL = 'https://glpre.yks365.net'
17
17
  const NPM_APP_PROD_URL = 'https://gl.yks365.net'
18
+ const packages = require('../../package.json')
18
19
 
19
- const getConfig = () => {
20
+ const getConfig = (version) => {
20
21
  let cdnConfigs = [
21
22
  {
22
23
  name: 'vue',
@@ -46,8 +47,10 @@ const getConfig = () => {
46
47
  {
47
48
  name: 'yks-element',
48
49
  library: 'YKSEMENT',
49
- js: `${NPM_APP_CDN_URL}/yks-element/1.2.6/yks.js`,
50
- css: `${NPM_APP_CDN_URL}/yks-element/1.2.6/theme-chalk/index.css`
50
+ js: `${NPM_APP_CDN_URL}/yks-element/${version || packages.version}/yks.js`,
51
+ css: `${NPM_APP_CDN_URL}/yks-element/${
52
+ version || packages.version
53
+ }/theme-chalk/index.css`
51
54
  },
52
55
  {
53
56
  name: 'lodash',
@@ -79,8 +82,8 @@ const externals = () => {
79
82
  return externals
80
83
  }
81
84
 
82
- const cdn = (env) => {
83
- const cdnConfig = getConfig()
85
+ const cdn = (env, version) => {
86
+ const cdnConfig = getConfig(version)
84
87
  const js = []
85
88
  const css = []
86
89
  cdnConfig.forEach((v) => {
@@ -94,9 +97,9 @@ const cdn = (env) => {
94
97
  }
95
98
  }
96
99
 
97
- const setPackParams = (config, env) => {
100
+ const setPackParams = (config, env, version) => {
98
101
  config.plugin('html').tap((args) => {
99
- let cdns = cdn(env)
102
+ let cdns = cdn(env, version)
100
103
  args[0].cdn = cdns
101
104
  return args
102
105
  })