Skip to content

Commit a54e0f4

Browse files
authored
Merge branch 'master' into fix-swiper-nocircular
2 parents 0857c12 + 1b4a2d4 commit a54e0f4

File tree

12 files changed

+43
-31
lines changed

12 files changed

+43
-31
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "2.10.12"
2+
"version": "2.10.13"
33
}

packages/api-proxy/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mpxjs/api-proxy",
3-
"version": "2.10.8",
3+
"version": "2.10.13",
44
"description": "convert miniprogram API at each end",
55
"module": "src/index.js",
66
"types": "@types/index.d.ts",
@@ -37,7 +37,7 @@
3737
},
3838
"homepage": "https://github.com/didi/mpx#readme",
3939
"dependencies": {
40-
"@mpxjs/utils": "^2.10.8",
40+
"@mpxjs/utils": "^2.10.13",
4141
"axios": "^1.7.3"
4242
},
4343
"peerDependencies": {

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mpxjs/core",
3-
"version": "2.10.12",
3+
"version": "2.10.13",
44
"description": "mpx runtime core",
55
"keywords": [
66
"miniprogram",
@@ -19,7 +19,7 @@
1919
],
2020
"main": "src/index.js",
2121
"dependencies": {
22-
"@mpxjs/utils": "^2.10.8",
22+
"@mpxjs/utils": "^2.10.13",
2323
"lodash": "^4.1.1",
2424
"miniprogram-api-typings": "^3.10.0"
2525
},

packages/fetch/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mpxjs/fetch",
3-
"version": "2.10.8",
3+
"version": "2.10.13",
44
"description": "mpx fetch lib",
55
"author": "donghongping",
66
"license": "Apache-2.0",
@@ -29,8 +29,8 @@
2929
"test": "echo \"Error: run tests from root\" && exit 1"
3030
},
3131
"dependencies": {
32-
"@mpxjs/api-proxy": "^2.10.8",
33-
"@mpxjs/utils": "^2.10.8",
32+
"@mpxjs/api-proxy": "^2.10.13",
33+
"@mpxjs/utils": "^2.10.13",
3434
"path-to-regexp": "^6.2.0"
3535
},
3636
"gitHead": "2d37697869b9bdda3efab92dda8c910b68fd05c0"

packages/pinia/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mpxjs/pinia",
3-
"version": "2.10.8",
3+
"version": "2.10.13",
44
"description": "A pinia style store in miniprogram",
55
"types": "@types/index.d.ts",
66
"main": "src/index.js",
@@ -31,7 +31,7 @@
3131
"access": "public"
3232
},
3333
"dependencies": {
34-
"@mpxjs/utils": "^2.10.8"
34+
"@mpxjs/utils": "^2.10.13"
3535
},
3636
"peerDependencies": {
3737
"@mpxjs/core": "^2.9.0",

packages/store/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mpxjs/store",
3-
"version": "2.10.8",
3+
"version": "2.10.13",
44
"description": "A store for mpx framework",
55
"main": "src/index.js",
66
"types": "@types/index.d.ts",
@@ -26,7 +26,7 @@
2626
},
2727
"homepage": "https://github.com/didi/mpx#readme",
2828
"dependencies": {
29-
"@mpxjs/utils": "^2.10.8"
29+
"@mpxjs/utils": "^2.10.13"
3030
},
3131
"peerDependencies": {
3232
"@mpxjs/core": "^2.9.0"

packages/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mpxjs/utils",
3-
"version": "2.10.8",
3+
"version": "2.10.13",
44
"description": "A toolkit for mpx framework",
55
"main": "src/index.js",
66
"scripts": {

packages/webpack-plugin/lib/react/processScript.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const normalize = require('../utils/normalize')
22
const optionProcessorPath = normalize.lib('runtime/optionProcessorReact')
3-
const { buildPagesMap, buildComponentsMap, getRequireScript, buildGlobalParams, stringifyRequest } = require('./script-helper')
3+
const { buildPagesMap, buildComponentsMap, getRequireScript, buildGlobalParams, stringifyRequest, buildI18n } = require('./script-helper')
44

55
module.exports = function (script, {
66
loaderContext,
@@ -17,7 +17,7 @@ module.exports = function (script, {
1717
componentGenerics,
1818
genericsInfo
1919
}, callback) {
20-
const { appInfo } = loaderContext.getMpx()
20+
const { appInfo, i18n } = loaderContext.getMpx()
2121

2222
let scriptSrcMode = srcMode
2323
if (script) {
@@ -62,6 +62,9 @@ import { getComponent, getAsyncSuspense } from ${stringifyRequest(loaderContext,
6262
})
6363

6464
output += buildGlobalParams({ moduleId, scriptSrcMode, loaderContext, isProduction, ctorType, jsonConfig, componentsMap, outputPath, genericsInfo, componentGenerics, hasApp })
65+
if (!hasApp && i18n) {
66+
output += buildI18n({ loaderContext })
67+
}
6568
output += getRequireScript({ ctorType, script, loaderContext })
6669
output += `export default global.__mpxOptionsMap[${JSON.stringify(moduleId)}]\n`
6770
}

packages/webpack-plugin/lib/web/processMainScript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import { processAppOption, getComponent } from ${stringifyRequest(loaderContext,
4949
Vue.use(VueRouter)\n`
5050

5151
if (i18n) {
52-
output += buildI18n({ i18n, loaderContext })
52+
output += buildI18n({ i18n, isMain: true, loaderContext })
5353
}
5454

5555
output += buildGlobalParams({

packages/webpack-plugin/lib/web/processScript.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const {
77
buildComponentsMap,
88
getRequireScript,
99
buildGlobalParams,
10-
stringifyRequest
10+
stringifyRequest,
11+
buildI18n
1112
} = require('./script-helper')
1213

1314
module.exports = function (script, {
@@ -24,7 +25,7 @@ module.exports = function (script, {
2425
wxsModuleMap,
2526
localComponentsMap
2627
}, callback) {
27-
const { projectRoot, appInfo, webConfig } = loaderContext.getMpx()
28+
const { projectRoot, appInfo, webConfig, i18n } = loaderContext.getMpx()
2829

2930
let output = '/* script */\n'
3031

@@ -70,6 +71,9 @@ module.exports = function (script, {
7071
}
7172

7273
content += buildGlobalParams({ moduleId, scriptSrcMode, loaderContext, isProduction, webConfig, hasApp })
74+
if (!hasApp && i18n) {
75+
content += buildI18n({ i18n, loaderContext })
76+
}
7377
content += getRequireScript({ ctorType, script, loaderContext })
7478
content += `
7579
export default processComponentOption({

0 commit comments

Comments
 (0)