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

build(deps): bump vite from 2.3.2 to 2.3.3

上级 e611c3e6
......@@ -79,7 +79,7 @@
"semver": "^7.3.4",
"ts-jest": "^26.4.4",
"typescript": "~4.1.3",
"vite": "^2.3.2",
"vite": "^2.3.3",
"vue": "^3.1.0-beta.3",
"yorkie": "^2.0.0"
}
......
......@@ -28,6 +28,6 @@
"compression": "^1.7.4",
"cypress": "^7.3.0",
"serve-static": "^1.14.1",
"vite": "^2.3.2"
"vite": "^2.3.3"
}
}
......@@ -2,5 +2,5 @@ import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [uni()],
plugins: [uni({ viteLegacyOptions: false })],
})
......@@ -8,9 +8,9 @@
integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==
"@babel/parser@^7.12.0", "@babel/parser@^7.13.9":
version "7.14.2"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.2.tgz#0c1680aa44ad4605b16cbdcc5c341a61bde9c746"
integrity sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ==
version "7.14.3"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.3.tgz#9b530eecb071fd0c93519df25c5ff9f14759f298"
integrity sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==
"@babel/types@^7.12.0", "@babel/types@^7.13.0":
version "7.14.2"
......@@ -91,7 +91,6 @@
localstorage-polyfill "^1.0.1"
pako "^2.0.3"
safe-area-insets "^1.4.1"
vue-router "^4.0.6"
xmlhttprequest "^1.8.0"
"@dcloudio/uni-i18n@../../uni-i18n":
......@@ -175,9 +174,9 @@
integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==
"@types/node@*":
version "15.0.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.3.tgz#ee09fcaac513576474c327da5818d421b98db88a"
integrity sha512-/WbxFeBU+0F79z9RdEOXH4CsDga+ibi5M8uEYr91u3CkT/pdWcV8MCook+4wDPnZBexRdwWS+PiVZ2xJviAzcQ==
version "15.3.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26"
integrity sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==
"@types/node@^14.14.31":
version "14.14.45"
......@@ -860,9 +859,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
electron-to-chromium@^1.3.723:
version "1.3.727"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz#857e310ca00f0b75da4e1db6ff0e073cc4a91ddf"
integrity sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==
version "1.3.730"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.730.tgz#6e1fad8f250827f5524672e572f823b34a6417e1"
integrity sha512-1Tr3h09wXhmqXnvDyrRe6MFgTeU0ZXy3+rMJWTrOHh/HNesWwBBrKnMxRJWZ86dzs8qQdw2c7ZE1/qeGHygImA==
elegant-spinner@^1.0.1:
version "1.0.1"
......@@ -891,10 +890,10 @@ end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"
esbuild@^0.11.20:
version "0.11.20"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.11.20.tgz#7cefa1aee8b372c184e42457885f7ce5d3e62a1e"
integrity sha512-QOZrVpN/Yz74xfat0H6euSgn3RnwLevY1mJTEXneukz1ln9qB+ieaerRMzSeETpz/UJWsBMzRVR/andBht5WKw==
esbuild@^0.11.23:
version "0.11.23"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.11.23.tgz#c42534f632e165120671d64db67883634333b4b8"
integrity sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==
escalade@^3.1.1:
version "3.1.1"
......@@ -1105,9 +1104,9 @@ forwarded@~0.1.2:
integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=
fraction.js@^4.0.13:
version "4.0.13"
resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.0.13.tgz#3c1c315fa16b35c85fffa95725a36fa729c69dfe"
integrity sha512-E1fz2Xs9ltlUp+qbiyx9wmt2n9dRzPsS11Jtdb8D2o+cC7wr9xkkKsVKJuBX0ST+LVS+LhLO+SbLJNtfWcJvXA==
version "4.1.0"
resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.1.0.tgz#229ec1cedc8c3c7e5d2d20688ba64f0a43af5830"
integrity sha512-o9lSKpK0TDqDwTL24Hxqi6I99s942l6TYkfl6WvGWgLOIFz/YonSGKfiSeMadoiNvTfqnfOa9mjb5SGVbBK9/w==
fresh@0.5.2:
version "0.5.2"
......@@ -1768,9 +1767,9 @@ negotiator@0.6.2:
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
node-releases@^1.1.71:
version "1.1.71"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb"
integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==
version "1.1.72"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe"
integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==
normalize-range@^0.1.2:
version "0.1.2"
......@@ -2115,9 +2114,9 @@ rollup-plugin-copy@^3.4.0:
is-plain-object "^3.0.0"
rollup@^2.38.5:
version "2.47.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.47.0.tgz#9d958aeb2c0f6a383cacc0401dff02b6e252664d"
integrity sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg==
version "2.48.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.48.0.tgz#fceb01ed771f991f29f7bd2ff7838146e55acb74"
integrity sha512-wl9ZSSSsi5579oscSDYSzGn092tCS076YB+TQrzsGuSfYyJeep8eEWj0eaRjuC5McuMNmcnR8icBqiE/FWNB1A==
optionalDependencies:
fsevents "~2.3.1"
......@@ -2477,23 +2476,18 @@ verror@1.10.0:
core-util-is "1.0.2"
extsprintf "^1.2.0"
vite@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.3.2.tgz#cfac76b04d4dee1c7303b55f563b5b62d32f41fe"
integrity sha512-QhLdOompDrfkyryCNTts9HE+eJhvhN9ibKNJ5Q8DpQai+6nOsuIlaveZNg67e1O/2QaWqXeBo82eHnAs1De2bQ==
vite@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.3.3.tgz#7e88a71abd03985c647789938d784cce0ee3b0fd"
integrity sha512-eO1iwRbn3/BfkNVMNJDeANAFCZ5NobYOFPu7IqfY7DcI7I9nFGjJIZid0EViTmLDGwwSUPmRAq3cRBbO3+DsMA==
dependencies:
esbuild "^0.11.20"
esbuild "^0.11.23"
postcss "^8.2.10"
resolve "^1.19.0"
rollup "^2.38.5"
optionalDependencies:
fsevents "~2.3.1"
vue-router@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.0.6.tgz#91750db507d26642f225b0ec6064568e5fe448d6"
integrity sha512-Y04llmK2PyaESj+N33VxLjGCUDuv9t4q2OpItEGU7POZiuQZaugV6cJpE6Qm1sVFtxufodLKN2y2dQl9nk0Reg==
vue@^3.1.0-beta.3:
version "3.1.0-beta.3"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.1.0-beta.3.tgz#ed7d944b3d276cbdcda8993f73833a05a182bd13"
......
......@@ -6,6 +6,6 @@
"bundler": "vite"
},
"dependencies": {
"vue-router": "^4.0.7"
"vue-router": "^4.0.8"
}
}
import path from 'path'
import vue from '@vitejs/plugin-vue'
import uni, { uniVueTemplateOptions } from '@dcloudio/vite-plugin-uni'
import uni from '@dcloudio/vite-plugin-uni'
/**
* @type {import('vite').UserConfig}
......@@ -23,10 +22,5 @@ export default {
},
},
plugins: [
vue({
template: uniVueTemplateOptions,
}),
uni({ inputDir: path.resolve(__dirname, 'src') }),
],
plugins: [uni({ viteLegacyOptions: false })],
}
......@@ -29,6 +29,6 @@
},
"peerDependencies": {
"@vue/shared": "^3.1.0-beta.3",
"vue-router": "^4.0.6"
"vue-router": "^4.0.8"
}
}
......@@ -3,8 +3,6 @@ import { extend } from '@vue/shared'
import { Plugin, ResolvedConfig } from 'vite'
import { FilterPattern } from '@rollup/pluginutils'
import vue from '@vitejs/plugin-vue'
import VueJsxPlugin from '@vitejs/plugin-vue-jsx'
import ViteLegacyPlugin from '@vitejs/plugin-legacy'
import { API_DEPS_CSS } from '@dcloudio/uni-cli-shared'
......@@ -86,15 +84,6 @@ const uniInjectPluginOptions: Partial<InjectOptions> = {
})
},
}
let vueJsxPlugin: typeof VueJsxPlugin | undefined
try {
vueJsxPlugin = require('@vitejs/plugin-vue-jsx')
} catch (e) {}
let viteLegacyPlugin: typeof ViteLegacyPlugin | undefined
try {
viteLegacyPlugin = require('@vitejs/plugin-legacy')
} catch (e) {}
export function initPlugins(
config: ResolvedConfig,
......@@ -171,24 +160,6 @@ export function initPlugins(
addPlugin(plugins, uniCopyPlugin(options), plugins.length)
}
if (viteLegacyPlugin && options.viteLegacyOptions !== false) {
;(
viteLegacyPlugin(options.viteLegacyOptions) as unknown as Plugin[]
).forEach((plugin) => {
if (!plugin.apply || plugin.apply === command) {
if (plugin.enforce === 'post') {
addPlugin(plugins, plugin, 'vite:import-analysis', 'pre')
} else {
addPlugin(plugins, plugin, 'vite:vue', 'pre')
}
}
})
}
if (vueJsxPlugin && options.vueJsxOptions !== false) {
addPlugin(plugins, vueJsxPlugin(options.vueJsxOptions), 'vite:vue', 'post')
}
if (process.env.DEBUG) {
debugPlugin(plugins.length)
debugPlugin(plugins.map((p) => (p as Plugin).name))
......
......@@ -3,6 +3,8 @@ import { UniCompiler, initUniCompiler } from '@dcloudio/uni-cli-shared'
import { Options as VueOptions } from '@vitejs/plugin-vue'
import { Options as ViteLegacyOptions } from '@vitejs/plugin-legacy'
import { VueJSXPluginOptions } from '@vue/babel-plugin-jsx'
import VueJsxPlugin from '@vitejs/plugin-vue-jsx'
import ViteLegacyPlugin from '@vitejs/plugin-legacy'
import { createConfig } from './config'
import { createConfigResolved } from './configResolved'
......@@ -28,9 +30,19 @@ export interface VitePluginUniResolvedOptions extends VitePluginUniOptions {
export * from './vue'
let createVueJsxPlugin: typeof VueJsxPlugin | undefined
try {
createVueJsxPlugin = require('@vitejs/plugin-vue-jsx')
} catch (e) {}
let createViteLegacyPlugin: typeof ViteLegacyPlugin | undefined
try {
createViteLegacyPlugin = require('@vitejs/plugin-legacy')
} catch (e) {}
export default function uniPlugin(
rawOptions: VitePluginUniOptions = {}
): Plugin {
): Plugin[] {
const options: VitePluginUniResolvedOptions = {
...rawOptions,
base: '/',
......@@ -43,11 +55,25 @@ export default function uniPlugin(
root: process.env.UNI_CLI_CONTEXT || process.cwd(),
}),
}
return {
const plugins: Plugin[] = []
if (createViteLegacyPlugin && options.viteLegacyOptions !== false) {
plugins.push(
...(createViteLegacyPlugin(
options.viteLegacyOptions
) as unknown as Plugin[])
)
}
if (createVueJsxPlugin && options.vueJsxOptions !== false) {
plugins.push(createVueJsxPlugin(options.vueJsxOptions))
}
plugins.push({
name: 'vite:uni',
config: createConfig(options),
configResolved: createConfigResolved(options),
configureServer: createConfigureServer(options),
handleHotUpdate: createHandleHotUpdate(options),
}
})
return plugins
}
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册