@mpxjs/webpack-plugin 2.9.69-beta.1 → 2.9.69-beta.10
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/config.js +3 -1
- package/lib/platform/template/wx/index.js +3 -1
- package/lib/react/processScript.js +6 -4
- package/lib/runtime/components/react/context.ts +17 -0
- package/lib/runtime/components/react/dist/context.js +2 -0
- package/lib/runtime/components/react/dist/getInnerListeners.js +2 -2
- package/lib/runtime/components/react/dist/locale-provider.jsx +15 -0
- package/lib/runtime/components/react/dist/mpx-button.jsx +16 -44
- package/lib/runtime/components/react/dist/mpx-image.jsx +13 -9
- package/lib/runtime/components/react/dist/mpx-picker/time.jsx +2 -1
- package/lib/runtime/components/react/dist/mpx-picker-view-column-item.jsx +2 -2
- package/lib/runtime/components/react/dist/mpx-picker-view-column.jsx +65 -61
- package/lib/runtime/components/react/dist/mpx-portal/portal-consumer.jsx +23 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-host.jsx +93 -0
- package/lib/runtime/components/react/dist/mpx-portal/portal-manager.jsx +40 -0
- package/lib/runtime/components/react/dist/mpx-portal.jsx +13 -0
- package/lib/runtime/components/react/dist/mpx-provider.jsx +31 -0
- package/lib/runtime/components/react/dist/mpx-root-portal.jsx +1 -1
- package/lib/runtime/components/react/dist/mpx-scroll-view.jsx +9 -5
- package/lib/runtime/components/react/dist/mpx-swiper-item.jsx +13 -7
- package/lib/runtime/components/react/dist/mpx-swiper.jsx +384 -321
- package/lib/runtime/components/react/dist/mpx-view.jsx +16 -20
- package/lib/runtime/components/react/dist/mpx-web-view.jsx +129 -53
- package/lib/runtime/components/react/dist/pickerFaces.js +2 -7
- package/lib/runtime/components/react/dist/useAnimationHooks.js +30 -13
- package/lib/runtime/components/react/dist/utils.jsx +60 -2
- package/lib/runtime/components/react/getInnerListeners.ts +2 -2
- package/lib/runtime/components/react/locale-provider.tsx +83 -0
- package/lib/runtime/components/react/mpx-button.tsx +20 -57
- package/lib/runtime/components/react/mpx-image.tsx +41 -25
- package/lib/runtime/components/react/mpx-picker/time.tsx +2 -1
- package/lib/runtime/components/react/mpx-picker-view-column-item.tsx +3 -3
- package/lib/runtime/components/react/mpx-picker-view-column.tsx +70 -69
- package/lib/runtime/components/react/mpx-portal/portal-consumer.tsx +32 -0
- package/lib/runtime/components/react/mpx-portal/portal-host.tsx +127 -0
- package/lib/runtime/components/react/mpx-portal/portal-manager.tsx +64 -0
- package/lib/runtime/components/react/mpx-portal.tsx +30 -0
- package/lib/runtime/components/react/mpx-provider.tsx +51 -0
- package/lib/runtime/components/react/mpx-root-portal.tsx +1 -1
- package/lib/runtime/components/react/mpx-scroll-view.tsx +10 -8
- package/lib/runtime/components/react/mpx-swiper-item.tsx +13 -7
- package/lib/runtime/components/react/mpx-swiper.tsx +378 -325
- package/lib/runtime/components/react/mpx-view.tsx +19 -22
- package/lib/runtime/components/react/mpx-web-view.tsx +170 -62
- package/lib/runtime/components/react/pickerFaces.ts +2 -7
- package/lib/runtime/components/react/types/global.d.ts +7 -0
- package/lib/runtime/components/react/useAnimationHooks.ts +34 -14
- package/lib/runtime/components/react/utils.tsx +67 -2
- package/lib/template-compiler/compiler.js +1 -1
- package/lib/wxss/loader.js +15 -2
- package/package.json +1 -1
package/lib/wxss/loader.js
CHANGED
|
@@ -32,6 +32,13 @@ const {
|
|
|
32
32
|
} = require('./utils')
|
|
33
33
|
const createHelpers = require('../helpers')
|
|
34
34
|
|
|
35
|
+
const RN_PRESET_OPTIMISATION = {
|
|
36
|
+
reduceInitial: false,
|
|
37
|
+
normalizeWhitespace: false,
|
|
38
|
+
minifyFontValues: false,
|
|
39
|
+
convertValues: false
|
|
40
|
+
}
|
|
41
|
+
|
|
35
42
|
module.exports = async function loader (content, map, meta) {
|
|
36
43
|
const rawOptions = this.getOptions(schema)
|
|
37
44
|
const plugins = []
|
|
@@ -41,6 +48,7 @@ module.exports = async function loader (content, map, meta) {
|
|
|
41
48
|
const externals = mpx.externals
|
|
42
49
|
const root = mpx.projectRoot
|
|
43
50
|
const sourceMap = mpx.cssSourceMap || false
|
|
51
|
+
const isRN = ['ios', 'android', 'harmony'].includes(mpx.mode)
|
|
44
52
|
|
|
45
53
|
let options
|
|
46
54
|
|
|
@@ -152,12 +160,17 @@ module.exports = async function loader (content, map, meta) {
|
|
|
152
160
|
if (this.minimize) {
|
|
153
161
|
const cssnano = require('cssnano')
|
|
154
162
|
const minimizeOptions = rawOptions.minimize || {}
|
|
163
|
+
const presetOptimisation = Object.assign(
|
|
164
|
+
{},
|
|
165
|
+
isRN ? RN_PRESET_OPTIMISATION : {},
|
|
166
|
+
minimizeOptions.optimisation
|
|
167
|
+
)
|
|
155
168
|
let cssnanoConfig = {
|
|
156
|
-
preset: ['cssnano-preset-default',
|
|
169
|
+
preset: ['cssnano-preset-default', presetOptimisation]
|
|
157
170
|
}
|
|
158
171
|
if (minimizeOptions.advanced) {
|
|
159
172
|
cssnanoConfig = {
|
|
160
|
-
preset: ['cssnano-preset-advanced',
|
|
173
|
+
preset: ['cssnano-preset-advanced', presetOptimisation]
|
|
161
174
|
}
|
|
162
175
|
}
|
|
163
176
|
plugins.push(cssnano(cssnanoConfig))
|