@dcloudio/vue-cli-plugin-uni 2.0.1-alpha-36320220919002 → 2.0.1-alpha-36720221014001

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/commands/build.js CHANGED
@@ -210,8 +210,7 @@ async function build (args, api, options) {
210
210
 
211
211
  if (process.env.UNI_PLATFORM === 'h5' && !isInHBuilderX) {
212
212
  console.log()
213
- console.log('欢迎将H5站部署到uniCloud前端网页托管平台,高速、免费、安全、省心,详见:')
214
- console.log('https://uniapp.dcloud.io/uniCloud/hosting')
213
+ console.log('欢迎将web站点部署到uniCloud前端网页托管平台,高速、免费、安全、省心,详见:https://uniapp.dcloud.io/uniCloud/hosting')
215
214
  }
216
215
  } else {
217
216
  const dirMsg = runByHBuilderX ? ''
package/generator.js CHANGED
@@ -52,6 +52,7 @@ module.exports = (api, options, rootOptions) => {
52
52
  scripts: {}
53
53
  },
54
54
  dependencies: {
55
+ '@dcloudio/uni-app': version,
55
56
  '@dcloudio/uni-app-plus': version,
56
57
  '@dcloudio/uni-h5': version,
57
58
  '@dcloudio/uni-mp-vue': version,
@@ -5,7 +5,8 @@ const {
5
5
  getMainEntry,
6
6
  getPlatformStat,
7
7
  getPlatformPush,
8
- getPlatformUniCloud
8
+ getPlatformUniCloud,
9
+ uniModulesLoader
9
10
  } = require('@dcloudio/uni-cli-shared')
10
11
 
11
12
  const vueLoader = require('@dcloudio/uni-cli-shared/lib/vue-loader')
@@ -65,7 +66,7 @@ const v3 = {
65
66
  const pushCode = getPlatformPush()
66
67
  const uniCloudCode = getPlatformUniCloud()
67
68
 
68
- const beforeCode = 'import \'uni-pages\';'
69
+ const beforeCode = `import 'uni-pages';import '${uniModulesLoader}!';`
69
70
  if (!webpackConfig.optimization) {
70
71
  webpackConfig.optimization = {}
71
72
  }
@@ -163,7 +164,7 @@ const v3 = {
163
164
  compiler: vueLoader.compiler,
164
165
  before: [
165
166
  beforeCode + require('../util').getAutomatorCode() + statCode + pushCode + uniCloudCode +
166
- getGlobalUsingComponentsCode()
167
+ getGlobalUsingComponentsCode()
167
168
  ]
168
169
  }
169
170
  }]
@@ -278,4 +279,4 @@ if (process.env.UNI_USING_V3) {
278
279
  module.exports = v3
279
280
  } else {
280
281
  module.exports = require('../mp')
281
- }
282
+ }
@@ -135,6 +135,7 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) {
135
135
  'process.env.UNI_PLATFORM': JSON.stringify(process.env.UNI_PLATFORM),
136
136
  'process.env.UNI_SUB_PLATFORM': JSON.stringify(process.env.UNI_SUB_PLATFORM),
137
137
  'process.env.UNI_CLOUD_PROVIDER': process.env.UNI_CLOUD_PROVIDER,
138
+ 'process.env.UNI_SECURE_NETWORK': process.env.UNI_SECURE_NETWORK,
138
139
  'process.env.UNICLOUD_DEBUG': process.env.UNICLOUD_DEBUG,
139
140
  'process.env.RUN_BY_HBUILDERX': process.env.RUN_BY_HBUILDERX,
140
141
  'process.env.UNI_AUTOMATOR_WS_ENDPOINT': JSON.stringify(process.env.UNI_AUTOMATOR_WS_ENDPOINT),
@@ -160,6 +161,14 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) {
160
161
  defines.__UNI_ROUTER_MODE__ = JSON.stringify('hash')
161
162
  }
162
163
 
164
+ if (process.env.UNI_CLOUD_PROVIDER && process.env.NODE_ENV !== 'development') {
165
+ webpackConfig.optimization.minimizer('terser').tap((args) => {
166
+ // reduce_vars 优化常量
167
+ args[0].terserOptions.compress.reduce_vars = true
168
+ return args
169
+ })
170
+ }
171
+
163
172
  webpackConfig
164
173
  .plugin('uni-define')
165
174
  .use(require.resolve('webpack/lib/DefinePlugin'), [defines])
@@ -383,7 +383,8 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
383
383
  JSON.stringify({
384
384
  type: 'stat'
385
385
  }),
386
- vuex: require.resolve('@dcloudio/vue-cli-plugin-uni/packages/vuex3')
386
+ vuex: require.resolve('@dcloudio/vue-cli-plugin-uni/packages/vuex3'),
387
+ '@vue/composition-api': require.resolve('@dcloudio/vue-cli-plugin-uni/packages/@vue/composition-api')
387
388
  },
388
389
  modules: [
389
390
  process.env.UNI_INPUT_DIR,
package/lib/env.js CHANGED
@@ -24,7 +24,8 @@ const {
24
24
  getManifestJson,
25
25
  isEnableUniPushV1,
26
26
  isEnableUniPushV2,
27
- isUniPushOffline
27
+ isUniPushOffline,
28
+ isEnableSecureNetwork
28
29
  } = require('@dcloudio/uni-cli-shared/lib/manifest')
29
30
 
30
31
  const manifestJsonObj = getManifestJson()
@@ -129,6 +130,9 @@ if (!process.env.UNI_CLOUD_PROVIDER && process.env.UNI_CLOUD_SPACES) {
129
130
  } catch (e) {}
130
131
  }
131
132
 
133
+ // 安全网络
134
+ process.env.UNI_SECURE_NETWORK = isEnableSecureNetwork(manifestJsonObj, process.env.UNI_PLATFORM)
135
+
132
136
  // 初始化环境变量
133
137
  process.env.UNI_CLI_CONTEXT = require('@dcloudio/uni-cli-shared/lib/util').getCLIContext()
134
138
 
package/lib/h5/index.js CHANGED
@@ -7,7 +7,8 @@ const {
7
7
  getH5Options,
8
8
  getPlatformStat,
9
9
  getPlatformPush,
10
- getPlatformUniCloud
10
+ getPlatformUniCloud,
11
+ uniModulesLoader
11
12
  } = require('@dcloudio/uni-cli-shared')
12
13
 
13
14
  const {
@@ -103,7 +104,7 @@ module.exports = {
103
104
  } catch (e) {}
104
105
 
105
106
  const beforeCode = (useBuiltIns === 'entry' ? 'import \'@babel/polyfill\';' : '') +
106
- `import 'uni-pages';import 'uni-${process.env.UNI_PLATFORM}';`
107
+ `import 'uni-pages';import 'uni-${process.env.UNI_PLATFORM}';import '${uniModulesLoader}!';`
107
108
 
108
109
  return {
109
110
  resolve: {
@@ -194,4 +195,4 @@ module.exports = {
194
195
  require('./cssnano-options')(webpackConfig)
195
196
  }
196
197
  }
197
- }
198
+ }
package/lib/mp/index.js CHANGED
@@ -9,7 +9,8 @@ const {
9
9
  getPlatformCssnano,
10
10
  getPlatformStat,
11
11
  getPlatformPush,
12
- getPlatformUniCloud
12
+ getPlatformUniCloud,
13
+ uniModulesLoader
13
14
  } = require('@dcloudio/uni-cli-shared')
14
15
 
15
16
  const WebpackUniAppPlugin = require('../../packages/webpack-uni-app-loader/plugin/index')
@@ -181,7 +182,7 @@ module.exports = {
181
182
  const pushCode = getPlatformPush()
182
183
  const uniCloudCode = getPlatformUniCloud()
183
184
 
184
- let beforeCode = 'import \'uni-pages\';'
185
+ let beforeCode = `import 'uni-pages';import '${uniModulesLoader}!';`
185
186
 
186
187
  const plugins = [
187
188
  new WebpackUniAppPlugin(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-uni",
3
- "version": "2.0.1-alpha-36320220919002",
3
+ "version": "2.0.1-alpha-36720221014001",
4
4
  "description": "uni-app plugin for vue-cli 3",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "author": "fxy060608",
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@dcloudio/uni-stat": "^2.0.1-alpha-36320220919002",
20
+ "@dcloudio/uni-stat": "^2.0.1-alpha-36720221014001",
21
21
  "buffer-json": "^2.0.0",
22
22
  "clone-deep": "^4.0.1",
23
23
  "cross-env": "^5.2.0",
@@ -41,5 +41,5 @@
41
41
  "copy-webpack-plugin": ">=5",
42
42
  "postcss": ">=7"
43
43
  },
44
- "gitHead": "b2851f78cf0ce4c18aa1e9c0033ab1bcc9306444"
44
+ "gitHead": "d30323ee8aad81efa6ad05e25053f36257f4f261"
45
45
  }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019-present, liximomo(X.L)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.