@dcloudio/vue-cli-plugin-hbuilderx 2.0.1-alpha-36020220901002 → 2.0.1-alpha-36120220907001

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.
@@ -13,6 +13,12 @@ const {
13
13
  getTemplatePath
14
14
  } = require('@dcloudio/uni-cli-shared')
15
15
  const fileLoader = require('@dcloudio/uni-cli-shared/lib/file-loader')
16
+ const {
17
+ compileI18nJsonStr
18
+ } = require('@dcloudio/uni-i18n')
19
+ const {
20
+ initI18nOptions
21
+ } = require('@dcloudio/uni-cli-shared/lib/i18n')
16
22
  const WebpackAppPlusNVuePlugin = process.env.UNI_USING_V3
17
23
  ? require('../packages/webpack-app-plus-plugin')
18
24
  : require('../packages/webpack-app-plus-nvue-plugin')
@@ -226,11 +232,25 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
226
232
  }]
227
233
  // 自动化测试时,不启用androidPrivacy.json
228
234
  if (!process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
229
- const androidPrivacyPath = path.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json')
230
- if (fs.existsSync(androidPrivacyPath)) {
235
+ const fileName = 'androidPrivacy.json'
236
+ const context = path.resolve(process.env.UNI_INPUT_DIR)
237
+ if (fs.existsSync(path.join(context, fileName))) {
231
238
  patterns.push({
232
- from: androidPrivacyPath,
233
- to: 'androidPrivacy.json'
239
+ from: fileName,
240
+ context,
241
+ to: fileName,
242
+ transform (content) {
243
+ const options = initI18nOptions(
244
+ process.env.UNI_PLATFORM,
245
+ process.env.UNI_INPUT_DIR,
246
+ false,
247
+ true
248
+ )
249
+ if (!options) {
250
+ return content
251
+ }
252
+ return compileI18nJsonStr(content.toString(), options)
253
+ }
234
254
  })
235
255
  }
236
256
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-hbuilderx",
3
- "version": "2.0.1-alpha-36020220901002",
3
+ "version": "2.0.1-alpha-36120220907001",
4
4
  "description": "HBuilderX plugin for vue-cli 3",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -18,5 +18,5 @@
18
18
  "css": "~2.2.1",
19
19
  "escodegen": "^1.8.1"
20
20
  },
21
- "gitHead": "c197ee509ba45b679a5eb11b6bd53e4dd9efb127"
21
+ "gitHead": "2290dd0b6f192129af9c6be83819277dff40fc66"
22
22
  }