提交 33152153 编写于 作者: fxy060608's avatar fxy060608

chore: update deps

上级 102c64bf
......@@ -25,6 +25,7 @@
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@rollup/pluginutils": "^4.1.1",
"clean-css": "^5.1.3",
"debug": "^4.3.2",
"fs-extra": "^10.0.0",
"postcss-import": "^14.0.2",
"postcss-load-config": "^3.1.0",
......
......@@ -8,7 +8,10 @@ export const isInHBuilderX = once(() => {
process.cwd(),
'../about/package.json'
))
return name === 'about'
if (name === 'about') {
process.env.UNI_HBUILDERX_PLUGINS = path.resolve(process.cwd(), '..')
return true
}
} catch (e) {
// console.error(e)
}
......
......@@ -24,9 +24,13 @@
"@rollup/pluginutils": "^4.1.1",
"@vue/compiler-dom": "3.2.21",
"@vue/compiler-sfc": "3.2.21",
"@vue/server-renderer": "3.2.21"
"@vue/server-renderer": "3.2.21",
"debug": "^4.3.2",
"mime": "^3.0.0",
"module-alias": "^2.2.2"
},
"devDependencies": {
"@types/mime": "^2.0.3",
"@vue/compiler-core": "3.2.21",
"esbuild": "^0.13.2"
}
......
......@@ -23,6 +23,7 @@
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"base64url": "^3.0.1",
"debug": "^4.3.2",
"magic-string": "^0.25.7"
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
......
{
"input": {
"src/index.js": ["dist/uni-stat.es.js", "dist/uni-stat.cjs.js"]
[
{
"input": {
"src/plugin/index.ts": "lib/uni.plugin.js"
},
"output": {
"format": "cjs"
},
"external": ["debug", "@dcloudio/uni-cli-shared"]
},
{
"input": {
"src/index.js": ["dist/uni-stat.es.js", "dist/uni-stat.cjs.js"]
}
}
}
]
const debug = require('debug')
const {
M,
defineUniMainJsPlugin,
getUniStatistics,
parseManifestJsonOnce,
parsePagesJsonOnce,
} = require('@dcloudio/uni-cli-shared')
'use strict'
module.exports = [
defineUniMainJsPlugin((opts) => {
var debug = require('debug')
var uniCliShared = require('@dcloudio/uni-cli-shared')
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}
var debug__default = /*#__PURE__*/ _interopDefaultLegacy(debug)
var index = [
uniCliShared.defineUniMainJsPlugin((opts) => {
let isEnable = false
return {
name: 'vite:uni-stat',
......@@ -19,26 +21,29 @@ module.exports = [
}
const inputDir = process.env.UNI_INPUT_DIR
const platform = process.env.UNI_PLATFORM
isEnable = getUniStatistics(inputDir, platform).enable === true
isEnable =
uniCliShared.getUniStatistics(inputDir, platform).enable === true
if (process.env.NODE_ENV === 'production') {
const manifestJson = parseManifestJsonOnce(inputDir)
const manifestJson = uniCliShared.parseManifestJsonOnce(inputDir)
if (!manifestJson.appid) {
console.log()
console.warn(M['stat.warn.appid'])
console.warn(uniCliShared.M['stat.warn.appid'])
console.log()
isEnable = false
}
}
const titlesJson = Object.create(null)
if (isEnable) {
parsePagesJsonOnce(inputDir, platform).pages.forEach((page) => {
const titleText = page.style.navigationBar.titleText || ''
if (titleText) {
titlesJson[page.path] = titleText
}
})
uniCliShared
.parsePagesJsonOnce(inputDir, platform)
.pages.forEach((page) => {
const titleText = page.style.navigationBar.titleText || ''
if (titleText) {
titlesJson[page.path] = titleText
}
})
}
debug('vite:uni:stat')('isEnable', isEnable)
debug__default['default']('vite:uni:stat')('isEnable', isEnable)
process.env.UNI_STAT_TITLE_JSON = JSON.stringify(titlesJson)
return {
define: {
......@@ -57,7 +62,6 @@ module.exports = [
}
}),
]
function isSsr(command, config) {
if (command === 'serve') {
return !!(config.server && config.server.middlewareMode)
......@@ -67,3 +71,5 @@ function isSsr(command, config) {
}
return false
}
module.exports = index
......@@ -18,5 +18,9 @@
"bugs": {
"url": "https://github.com/dcloudio/uni-app/issues"
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da"
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "workspace:3.0.0-alpha-3021320211109003",
"debug": "^4.3.2"
}
}
import type { ConfigEnv, UserConfig } from 'vite'
import debug from 'debug'
import {
M,
defineUniMainJsPlugin,
getUniStatistics,
parseManifestJsonOnce,
parsePagesJsonOnce,
} from '@dcloudio/uni-cli-shared'
export default [
defineUniMainJsPlugin((opts) => {
let isEnable = false
return {
name: 'vite:uni-stat',
enforce: 'pre',
config(config, env) {
if (isSsr(env.command, config)) {
return
}
const inputDir = process.env.UNI_INPUT_DIR!
const platform = process.env.UNI_PLATFORM!
isEnable = getUniStatistics(inputDir, platform).enable === true
if (process.env.NODE_ENV === 'production') {
const manifestJson = parseManifestJsonOnce(inputDir)
if (!manifestJson.appid) {
console.log()
console.warn(M['stat.warn.appid'])
console.log()
isEnable = false
}
}
const titlesJson = Object.create(null)
if (isEnable) {
parsePagesJsonOnce(inputDir, platform).pages.forEach((page: any) => {
const titleText = page.style.navigationBar.titleText || ''
if (titleText) {
titlesJson[page.path] = titleText
}
})
}
debug('vite:uni:stat')('isEnable', isEnable)
process.env.UNI_STAT_TITLE_JSON = JSON.stringify(titlesJson)
return {
define: {
'process.env.UNI_STAT_TITLE_JSON': process.env.UNI_STAT_TITLE_JSON,
},
}
},
transform(code, id) {
if (isEnable && opts.filter(id)) {
return {
code: code + `;import '@dcloudio/uni-stat';`,
map: null,
}
}
},
}
}),
]
function isSsr(command: ConfigEnv['command'], config: UserConfig) {
if (command === 'serve') {
return !!(config.server && config.server.middlewareMode)
}
if (command === 'build') {
return !!(config.build && config.build.ssr)
}
return false
}
......@@ -36,14 +36,10 @@
"estree-walker": "^2.0.2",
"express": "^4.17.1",
"fs-extra": "^10.0.0",
"jsonc-parser": "^3.0.0",
"mime": "^2.5.2",
"module-alias": "^2.2.2"
"jsonc-parser": "^3.0.0"
},
"devDependencies": {
"@types/express": "^4.17.12",
"@types/mime": "^2.0.3",
"@types/module-alias": "^2.0.0",
"@types/sass": "^1.16.0",
"@vue/babel-plugin-jsx": "^1.1.1",
"chokidar": "^3.5.2"
......
......@@ -197,6 +197,7 @@ importers:
'@rollup/pluginutils': ^4.1.1
'@vue/compiler-core': 3.2.21
clean-css: ^5.1.3
debug: ^4.3.2
fs-extra: ^10.0.0
postcss-import: ^14.0.2
postcss-load-config: ^3.1.0
......@@ -208,6 +209,7 @@ importers:
'@dcloudio/uni-shared': link:../uni-shared
'@rollup/pluginutils': 4.1.1
clean-css: 5.2.2
debug: 4.3.2
fs-extra: 10.0.0
postcss-import: 14.0.2
postcss-load-config: 3.1.0
......@@ -268,6 +270,7 @@ importers:
loader-utils: ^1.1.0
lru-cache: ^4.1.2
merge-source-map: ^1.1.0
module-alias: ^2.2.2
postcss: ^8.3.8
postcss-comment: ^2.0.0
postcss-import: ^14.0.2
......@@ -305,6 +308,7 @@ importers:
loader-utils: 1.4.0
lru-cache: 4.1.5
merge-source-map: 1.1.0
module-alias: 2.2.2
postcss: 8.3.11
postcss-comment: 2.0.0
postcss-import: 14.0.2_postcss@8.3.11
......@@ -336,6 +340,7 @@ importers:
'@rollup/pluginutils': ^4.1.1
'@types/hash-sum': ^1.0.0
'@types/less': ^3.0.3
'@types/mime': ^2.0.3
'@types/stylus': ^0.48.36
'@vue/compiler-core': 3.2.21
'@vue/compiler-dom': 3.2.21
......@@ -352,6 +357,8 @@ importers:
jsonc-parser: ^3.0.0
magic-string: ^0.25.7
merge: ^2.1.1
mime: ^3.0.0
module-alias: ^2.2.2
postcss: ^8.3.8
postcss-import: ^14.0.2
postcss-load-config: ^3.1.0
......@@ -379,6 +386,8 @@ importers:
jsonc-parser: 3.0.0
magic-string: 0.25.7
merge: 2.1.1
mime: 3.0.0
module-alias: 2.2.2
postcss-import: 14.0.2_postcss@8.3.11
postcss-load-config: 3.1.0
postcss-selector-parser: 6.0.6
......@@ -388,6 +397,7 @@ importers:
devDependencies:
'@types/hash-sum': 1.0.0
'@types/less': 3.0.3
'@types/mime': 2.0.3
'@types/stylus': 0.48.36
'@vue/compiler-sfc': 3.2.21
postcss: 8.3.11
......@@ -458,11 +468,15 @@ importers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3021320211109003
'@dcloudio/uni-shared': 3.0.0-alpha-3021320211109003
'@rollup/pluginutils': ^4.1.1
'@types/mime': ^2.0.3
'@vue/compiler-core': 3.2.21
'@vue/compiler-dom': 3.2.21
'@vue/compiler-sfc': 3.2.21
'@vue/server-renderer': 3.2.21
debug: ^4.3.2
esbuild: ^0.13.2
mime: ^3.0.0
module-alias: ^2.2.2
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-shared': link:../uni-shared
......@@ -470,7 +484,11 @@ importers:
'@vue/compiler-dom': 3.2.21
'@vue/compiler-sfc': 3.2.21
'@vue/server-renderer': 3.2.21_vue@3.2.21
debug: 4.3.2
mime: 3.0.0
module-alias: 2.2.2
devDependencies:
'@types/mime': 2.0.3
'@vue/compiler-core': 3.2.21
esbuild: 0.13.12
......@@ -607,6 +625,7 @@ importers:
'@dcloudio/uni-shared': 3.0.0-alpha-3021320211109003
'@vue/compiler-sfc': 3.2.21
base64url: ^3.0.1
debug: ^4.3.2
magic-string: ^0.25.7
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
......@@ -614,6 +633,7 @@ importers:
'@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-shared': link:../uni-shared
base64url: 3.0.1
debug: 4.3.2
magic-string: 0.25.7
devDependencies:
'@vue/compiler-sfc': 3.2.21
......@@ -657,7 +677,12 @@ importers:
'@vue/runtime-core': 3.2.21
packages/uni-stat:
specifiers: {}
specifiers:
'@dcloudio/uni-cli-shared': workspace:3.0.0-alpha-3021320211109003
debug: ^4.3.2
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
debug: 4.3.2
packages/uni-vue:
specifiers:
......@@ -673,8 +698,6 @@ importers:
'@dcloudio/uni-shared': 3.0.0-alpha-3021320211109003
'@rollup/pluginutils': ^4.1.1
'@types/express': ^4.17.12
'@types/mime': ^2.0.3
'@types/module-alias': ^2.0.0
'@types/sass': ^1.16.0
'@vitejs/plugin-legacy': ^1.6.2
'@vitejs/plugin-vue': ^1.9.4
......@@ -690,8 +713,6 @@ importers:
express: ^4.17.1
fs-extra: ^10.0.0
jsonc-parser: ^3.0.0
mime: ^2.5.2
module-alias: ^2.2.2
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-shared': link:../uni-shared
......@@ -708,12 +729,8 @@ importers:
express: 4.17.1
fs-extra: 10.0.0
jsonc-parser: 3.0.0
mime: 2.6.0
module-alias: 2.2.2
devDependencies:
'@types/express': 4.17.13
'@types/mime': 2.0.3
'@types/module-alias': 2.0.1
'@types/sass': 1.43.0
'@vue/babel-plugin-jsx': 1.1.1
chokidar: 3.5.2
......@@ -2554,10 +2571,6 @@ packages:
resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==}
dev: false
/@types/module-alias/2.0.1:
resolution: {integrity: sha512-DN/CCT1HQG6HquBNJdLkvV+4v5l/oEuwOHUPLxI+Eub0NED+lk0YUfba04WGH90EINiUrNgClkNnwGmbICeWMQ==}
dev: true
/@types/ms/0.7.31:
resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==}
dev: true
......@@ -6623,9 +6636,9 @@ packages:
hasBin: true
requiresBuild: true
/mime/2.6.0:
resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
engines: {node: '>=4.0.0'}
/mime/3.0.0:
resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==}
engines: {node: '>=10.0.0'}
hasBin: true
dev: false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册