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

refactor(cli): easycom

上级 9b23e528
......@@ -335,144 +335,6 @@ uni-actionsheet .uni-actionsheet__cell:active {
uni-actionsheet .uni-actionsheet__cell:first-child:before {
display: none;
}
* {
margin: 0;
-webkit-tap-highlight-color: transparent;
}
@font-face {
font-weight: normal;
font-style: normal;
font-family: "uni";
src: url('data:application/octet-stream;base64,AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzJAKEx+AAABfAAAAFZjbWFw65cFHQAAAhwAAAJQZ2x5ZvCRR/EAAASUAAAKtGhlYWQLKIN9AAAA4AAAADZoaGVhCCwD+gAAALwAAAAkaG10eEJo//8AAAHUAAAASGxvY2EYqhW6AAAEbAAAACZtYXhwASEAVQAAARgAAAAgbmFtZeNcHtgAAA9IAAAB5nBvc3T6bLhLAAARMAAAAOYAAQAAA+gAAABaA+j/////A+kAAQAAAAAAAAAAAAAAAAAAABIAAQAAAAEAACkCj3dfDzz1AAsD6AAAAADUER9XAAAAANQRH1f//wAAA+kD6gAAAAgAAgAAAAAAAAABAAAAEgBJAAUAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKAB4ALAABREZMVAAIAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAAAAQOwAZAABQAIAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA6gHqEQPoAAAAWgPqAAAAAAABAAAAAAAAAAAAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+j//wPoAAAD6AAAAAAABQAAAAMAAAAsAAAABAAAAXQAAQAAAAAAbgADAAEAAAAsAAMACgAAAXQABABCAAAABAAEAAEAAOoR//8AAOoB//8AAAABAAQAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwA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XIEYmFjawZkZWxldGUAAAAA') format('truetype');
}
@font-face {
font-weight: normal;
font-style: normal;
font-family: "unibtn";
src: url('data:application/octet-stream;base64,AAEAAAALAIAAAwAwT1MvMg8SAzoAAAC8AAAAYGNtYXAAILNAAAABHAAAAGRnYXNwAAAAEAAAAYAAAAAIZ2x5ZnVT/G4AAAGIAAAEHGhlYWQOAdVuAAAFpAAAADZoaGVhB3wDzAAABdwAAAAkaG10eCIABqYAAAYAAAAALGxvY2EDqgTMAAAGLAAAABhtYXhwAA8ATQAABkQAAAAgbmFtZXBR8sQAAAZkAAAB2nBvc3QAAwAAAAAIQAAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADmUAPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQASAAAAA4ACAACAAYAAQAg5gLmBuZQ//3//wAAAAAAIOYA5gTmUP/9//8AAf/jGgQaAxm6AAMAAQAAAAAAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQFgAHkCwQLqABYAAAEmNDc2MhcBHgEVFAYHAQYiJyY0NwkBAWAICAcWBwE1BAQEBP7LBxYHCAgBIv7eAsUHFwcICP7cBAsFBgsE/twICAcXCAETARMAAAEBWAB5ArkC6gAXAAAJAhYUBwYiJwEuATU0NjcBNjIXFhQHMQK5/t4BIggICBUI/swFAwMFATQIFQgICALF/u3+7QgXBwgIASQECwYFCwQBJAgIBxcHAAACANAAaQO6Aw0AHAA2AAAlFAYjISImNRE0NjsBNSMiBhURFBYzITI2PQEjFRMnBxcHDgMPATM1PgE3PgE/AgcXNyc3A1IHBP3CBAYGBLDAERgYEQJfERcuaKQhbndKgmM9BQEvBTYtLXVABmpuIaQBAaUEBwcE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QAAWAEAAFYBAAA0AQAAJcEAAC/BAAA3AQAAOwAAAAAAAoAFAAeAEoAdgDGAToBmgHSAg4AAQAAAAsASwADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAA4AAAABAAAAAAACAAcAnwABAAAAAAADAA4ASwABAAAAAAAEAA4AtAABAAAAAAAFAAsAKgABAAAAAAAGAA4AdQABAAAAAAAKABoA3gADAAEECQABABwADgADAAEECQACAA4ApgADAAEECQADABwAWQADAAEECQAEABwAwgADAAEECQAFABYANQADAAEECQAGABwAgwADAAEECQAKADQA+HN0cmVhbWljb25mb250AHMAdAByAGUAYQBtAGkAYwBvAG4AZgBvAG4AdFZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMHN0cmVhbWljb25mb250AHMAdAByAGUAYQBtAGkAYwBvAG4AZgBvAG4AdHN0cmVhbWljb25mb250AHMAdAByAGUAYQBtAGkAYwBvAG4AZgBvAG4AdFJlZ3VsYXIAUgBlAGcAdQBsAGEAcnN0cmVhbWljb25mb250AHMAdAByAGUAYQBtAGkAYwBvAG4AZgBvAG4AdEZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=') format('truetype')
}
html,
body {
-webkit-user-select: none;
user-select: none;
width: 100%;
height: 100%;
}
body {
overflow-x: hidden;
}
[class^="uni-icon-"],
[class*=" uni-icon-"] {
display: inline-block;
vertical-align: middle;
font: normal normal normal 14px/1 "uni";
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
}
[class^="uni-btn-icon"],
[class*=" uni-btn-icon"] {
display: inline-block;
font: normal normal normal 14px/1 "unibtn";
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
}
[class^="uni-btn-icon"]:before,
[class*=" uni-btn-icon"]:before {
margin: 0;
box-sizing: border-box;
}
.uni-icon-success-no-circle:before {
content: "\EA08";
}
.uni-loading,
uni-button[loading]:before {
background: transparent url("data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=") no-repeat;
}
.uni-loading {
width: 20px;
height: 20px;
display: inline-block;
vertical-align: middle;
animation: uni-loading 1s steps(12, end) infinite;
background-size: 100%;
}
@keyframes uni-loading {
0% {
transform: rotate3d(0, 0, 1, 0deg);
}
100% {
transform: rotate3d(0, 0, 1, 360deg);
}
}
.uni-mask {
position: fixed;
z-index: 999;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
}
.uni-fade-enter-active,
.uni-fade-leave-active {
transition-duration: 0.25s;
transition-property: opacity;
transition-timing-function: ease;
}
.uni-fade-enter,
.uni-fade-leave-active {
opacity: 0
}
[nvue] uni-view,
[nvue] uni-swiper-item,
[nvue] uni-scroll-view {
display: flex;
flex-shrink: 0;
flex-grow: 0;
flex-basis: auto;
align-items: stretch;
align-content: flex-start;
}
[nvue-dir-row] uni-view,
[nvue-dir-row] uni-swiper-item {
flex-direction: row;
}
[nvue-dir-column] uni-view,
[nvue-dir-column] uni-swiper-item {
flex-direction: column;
}
[nvue-dir-row-reverse] uni-view,
[nvue-dir-row-reverse] uni-swiper-item {
flex-direction: row-reverse;
}
[nvue-dir-column-reverse] uni-view,
[nvue-dir-column-reverse] uni-swiper-item {
flex-direction: column-reverse;
}
[nvue] uni-view,
[nvue] uni-image,
[nvue] uni-input,
[nvue] uni-scroll-view,
[nvue] uni-swiper,
[nvue] uni-swiper-item,
[nvue] uni-text,
[nvue] uni-textarea,
[nvue] uni-video {
position: relative;
border: 0px solid #000000;
box-sizing: border-box;
}
[nvue] uni-swiper-item {
position: absolute;
}
uni-app {
display: block;
box-sizing: border-box;
width: 100%;
height: 100%;
}
uni-canvas {
width: 300px;
......@@ -1240,7 +1102,7 @@ uni-scroll-view[hidden] {
position: relative;
-webkit-overflow-scrolling: touch;
width: 100%;
/* display: flex; 时在安卓下会导致scrollWidth和offsetWidth一样 */
height: 100%;
max-height: inherit;
}
......@@ -1496,6 +1358,7 @@ uni-textarea[hidden] {
text-transform: inherit;
text-shadow: inherit;
}
/* 用于解决 iOS textarea 内部默认边距 */
.uni-textarea-textarea-fix-margin {
width: auto;
right: 0;
......
此差异已折叠。
var attrs = ["top", "left", "right", "bottom"];
var inited;
var elementComputedStyle = {};
var support;
function getSupport() {
if (!("CSS" in window) || typeof CSS.supports != "function") {
support = "";
} else if (CSS.supports("top: env(safe-area-inset-top)")) {
support = "env";
} else if (CSS.supports("top: constant(safe-area-inset-top)")) {
support = "constant";
} else {
support = "";
}
return support;
}
function init() {
support = typeof support === "string" ? support : getSupport();
if (!support) {
attrs.forEach(function(attr) {
elementComputedStyle[attr] = 0;
});
return;
}
function setStyle(el, style) {
var elStyle = el.style;
Object.keys(style).forEach(function(key) {
var val = style[key];
elStyle[key] = val;
});
}
var cbs = [];
function parentReady(callback) {
if (callback) {
cbs.push(callback);
} else {
cbs.forEach(function(cb) {
cb();
});
}
}
var passiveEvents = false;
try {
var opts = Object.defineProperty({}, "passive", {
get: function() {
passiveEvents = {passive: true};
}
});
window.addEventListener("test", null, opts);
} catch (e) {
}
function addChild(parent, attr) {
var a1 = document.createElement("div");
var a2 = document.createElement("div");
var a1Children = document.createElement("div");
var a2Children = document.createElement("div");
var W = 100;
var MAX = 1e4;
var aStyle = {
position: "absolute",
width: W + "px",
height: "200px",
boxSizing: "border-box",
overflow: "hidden",
paddingBottom: support + "(safe-area-inset-" + attr + ")"
};
setStyle(a1, aStyle);
setStyle(a2, aStyle);
setStyle(a1Children, {
transition: "0s",
animation: "none",
width: "400px",
height: "400px"
});
setStyle(a2Children, {
transition: "0s",
animation: "none",
width: "250%",
height: "250%"
});
a1.appendChild(a1Children);
a2.appendChild(a2Children);
parent.appendChild(a1);
parent.appendChild(a2);
parentReady(function() {
a1.scrollTop = a2.scrollTop = MAX;
var a1LastScrollTop = a1.scrollTop;
var a2LastScrollTop = a2.scrollTop;
function onScroll() {
if (this.scrollTop === (this === a1 ? a1LastScrollTop : a2LastScrollTop)) {
return;
}
a1.scrollTop = a2.scrollTop = MAX;
a1LastScrollTop = a1.scrollTop;
a2LastScrollTop = a2.scrollTop;
attrChange(attr);
}
a1.addEventListener("scroll", onScroll, passiveEvents);
a2.addEventListener("scroll", onScroll, passiveEvents);
});
var computedStyle = getComputedStyle(a1);
Object.defineProperty(elementComputedStyle, attr, {
configurable: true,
get: function() {
return parseFloat(computedStyle.paddingBottom);
}
});
}
var parentDiv = document.createElement("div");
setStyle(parentDiv, {
position: "absolute",
left: "0",
top: "0",
width: "0",
height: "0",
zIndex: "-1",
overflow: "hidden",
visibility: "hidden"
});
attrs.forEach(function(key) {
addChild(parentDiv, key);
});
document.body.appendChild(parentDiv);
parentReady();
inited = true;
}
function getAttr(attr) {
if (!inited) {
init();
}
return elementComputedStyle[attr];
}
var changeAttrs = [];
function attrChange(attr) {
if (!changeAttrs.length) {
setTimeout(function() {
var style = {};
changeAttrs.forEach(function(attr2) {
style[attr2] = elementComputedStyle[attr2];
});
changeAttrs.length = 0;
callbacks.forEach(function(callback) {
callback(style);
});
}, 0);
}
changeAttrs.push(attr);
}
var callbacks = [];
function onChange(callback) {
if (!getSupport()) {
return;
}
if (!inited) {
init();
}
if (typeof callback === "function") {
callbacks.push(callback);
}
}
function offChange(callback) {
var index = callbacks.indexOf(callback);
if (index >= 0) {
callbacks.splice(index, 1);
}
}
var safeAreaInsets = {
get support() {
return (typeof support === "string" ? support : getSupport()).length != 0;
},
get top() {
return getAttr("top");
},
get left() {
return getAttr("left");
},
get right() {
return getAttr("right");
},
get bottom() {
return getAttr("bottom");
},
onChange,
offChange
};
var out = safeAreaInsets;
export {out as o};
import {
ExpressionNode,
SimpleExpressionNode,
TransformContext,
} from '@vue/compiler-core'
interface ImportItem {
exp: string | ExpressionNode
path: string
}
export function addAutoImport(
importItem: ImportItem,
context: TransformContext
) {
const importPath = importItem.path
const importContent = (importItem.exp as SimpleExpressionNode).content
const importsArray = Array.from(context.imports)
const existing = importsArray.find(
(i) =>
i.path === importPath &&
(i.exp as SimpleExpressionNode).content === importContent
)
if (existing) {
return
}
context.imports.add(importItem)
return true
}
export * from './vue'
export * from './json'
export * from './easycom/index'
export * from './preprocess/index'
import { CompilerOptions } from '@vue/compiler-sfc'
import {
COMPONENT_PREFIX,
isNativeTag,
isBuiltInComponent,
} from '@dcloudio/uni-shared'
import { isEasycomTag } from '../easycom'
import { transformEasycom, transformBuiltInEasycom } from './transforms/easycom'
import { transformBuiltInComponent } from './transforms/builtInComponent'
interface CodegenContext {
push: (code: string, node: any) => void
helper: (key: symbol) => string
}
interface VueCompilerOptions extends CompilerOptions {
onContextCreated: (context: CodegenContext) => void
}
function isAutoImported(tag: string) {
return (
isEasycomTag(tag) || isBuiltInComponent(tag.replace(COMPONENT_PREFIX, ''))
)
}
const resolveComponentRE = /_resolveComponent\("(.*)"\)/
export const vueCompilerOptions: VueCompilerOptions = {
onContextCreated(context) {
const oldPush = context.push
context.push = (code, node) => {
const matches = code.match(resolveComponentRE)
// ignore auto imported component
if (matches && matches.length === 2 && isAutoImported(matches[1])) {
code = `// ${code}`
}
return oldPush(code, node)
}
},
isNativeTag,
nodeTransforms: [
transformBuiltInComponent,
transformBuiltInEasycom,
transformEasycom,
],
}
import { camelize, capitalize } from '@vue/shared'
import {
ConstantTypes,
NodeTransform,
ElementNode,
createSimpleExpression,
toValidAssetId,
} from '@vue/compiler-core'
import { COMPONENT_PREFIX, isBuiltInComponent } from '@dcloudio/uni-shared'
import { addAutoImport, isComponentNode } from '../../easycom'
const COMPONENTS_PATH = '@dcloudio/uni-h5/dist/uni-h5.esm.js'
const COMPONENTS_STYLE_PATH = '@dcloudio/uni-h5/style/'
function createComponentImportItem(oldTag: string, node: ElementNode) {
const tag = node.tag
return {
path: COMPONENTS_PATH,
exp: createSimpleExpression(
`{ ${capitalize(camelize(oldTag))} as ${toValidAssetId(
tag,
'component'
)} }`,
false,
node.loc,
ConstantTypes.CAN_HOIST
),
}
}
function createStyleImportItem(oldTag: string, node: ElementNode) {
return {
path: COMPONENTS_STYLE_PATH + oldTag + '.css',
exp: createSimpleExpression(
toValidAssetId(node.tag, 'style' as any),
false,
node.loc,
ConstantTypes.CAN_HOIST
),
}
}
export const transformBuiltInComponent: NodeTransform = (node, context) => {
if (process.env.UNI_PLATFORM !== 'h5') {
return
}
if (!isComponentNode(node)) {
return
}
const tag = node.tag
if (!isBuiltInComponent(tag)) {
return
}
node.tag = COMPONENT_PREFIX + tag
if (addAutoImport(createComponentImportItem(tag, node), context)) {
addAutoImport(createStyleImportItem(tag, node), context)
}
}
import { camelize, capitalize } from '@vue/shared'
import {
ConstantTypes,
NodeTransform,
createSimpleExpression,
toValidAssetId,
ComponentNode,
TransformContext,
} from '@vue/compiler-core'
import { COMPONENT_PREFIX } from '@dcloudio/uni-shared'
import {
addEasycomTag,
debugEasycom,
matchEasycom,
addAutoImport,
isComponentNode,
} from '../../easycom'
function createImportItem(path: string, node: ComponentNode) {
const tag = node.tag
return {
path,
exp: createSimpleExpression(
toValidAssetId(tag, 'component'),
false,
node.loc,
ConstantTypes.CAN_HOIST
),
}
}
function isBinding(tag: string, context: TransformContext) {
const bindings = context.bindingMetadata
if (!bindings) {
return false
}
if (bindings[tag]) {
return true
}
const camelName = camelize(tag)
if (bindings[camelName]) {
return true
}
const PascalName = capitalize(camelName)
if (bindings[PascalName]) {
return true
}
return false
}
export const transformEasycom: NodeTransform = (node, context) => {
if (!isComponentNode(node)) {
return
}
const tag = node.tag
// built-in component
if (tag.startsWith(COMPONENT_PREFIX)) {
return
}
// https://github.com/vuejs/rfcs/blob/script-setup-2/active-rfcs/0000-script-setup.md#exposing-components-and-directives
if (isBinding(tag, context)) {
return debugEasycom(tag + ' is binding by setup')
}
const path = matchEasycom(tag)
if (path) {
addEasycomTag(tag)
addAutoImport(createImportItem(path, node), context)
}
}
export const transformBuiltInEasycom: NodeTransform = (node) => {
if (!isComponentNode(node)) {
return
}
if (node.tag === 'match-media' && process.env.UNI_PLATFORM !== 'mp-weixin') {
node.tag = 'uni-match-media'
}
}
......@@ -25,6 +25,6 @@
},
"dependencies": {
"safe-area-insets": "^1.4.1",
"vue-router": "^4.0.0-beta.6"
"vue-router": "^4.0.3"
}
}
......@@ -3,23 +3,23 @@ import { App } from 'vue'
import { COMPONENT_NAME_PREFIX } from '@dcloudio/uni-shared'
import AppComponent from '../components/app/index.vue'
// import PageComponent from '../components/page/index.vue'
// import AsyncErrorComponent from '../components/async-error/index.vue'
// import AsyncLoadingComponent from '../components/async-loading/index.vue'
import PageComponent from '../components/page/index.vue'
import AsyncErrorComponent from '../components/async-error/index.vue'
import AsyncLoadingComponent from '../components/async-loading/index.vue'
export function initSystemComponents(app: App) {
// @ts-ignore
AppComponent.name = COMPONENT_NAME_PREFIX + AppComponent.name
// // @ts-ignore
// PageComponent.name = COMPONENT_NAME_PREFIX + PageComponent.name
// // @ts-ignore
// AsyncErrorComponent.name = COMPONENT_NAME_PREFIX + AsyncErrorComponent.name
// // @ts-ignore
// AsyncLoadingComponent.name =
// COMPONENT_NAME_PREFIX + AsyncLoadingComponent.name
// @ts-ignore
PageComponent.name = COMPONENT_NAME_PREFIX + PageComponent.name
// @ts-ignore
AsyncErrorComponent.name = COMPONENT_NAME_PREFIX + AsyncErrorComponent.name
// @ts-ignore
AsyncLoadingComponent.name =
COMPONENT_NAME_PREFIX + AsyncLoadingComponent.name
app.component(AppComponent.name, AppComponent)
// app.component(PageComponent.name, PageComponent)
// app.component(AsyncErrorComponent.name, AsyncErrorComponent)
// app.component(AsyncLoadingComponent.name, AsyncLoadingComponent)
app.component(PageComponent.name, PageComponent)
app.component(AsyncErrorComponent.name, AsyncErrorComponent)
app.component(AsyncLoadingComponent.name, AsyncLoadingComponent)
}
......@@ -178,11 +178,9 @@ uni-page {
position: absolute;
}
uni-app {
display: block;
box-sizing: border-box;
width: 100%;
height: 100%;
}
\ No newline at end of file
}
......@@ -31,7 +31,8 @@
},
"peerDependencies": {
"@dcloudio/uni-cli-shared": "^3.0.0",
"vite": "^2.0.0-beta.31"
"@dcloudio/uni-shared": "^3.0.0",
"vite": "^2.0.0-beta.47"
},
"devDependencies": {
"@types/sass": "^1.16.0"
......
/**
* https://github.com/rollup/plugins/blob/master/packages/json/src/index.js
*
* This source code is licensed under the MIT license found in the
* LICENSE file at
* https://github.com/rollup/plugins/blob/master/LICENSE
*/
import { createFilter, dataToEsm } from '@rollup/pluginutils'
import { FilterPattern } from '@rollup/pluginutils'
import { Plugin } from 'rollup'
export interface RollupJsonOptions {
/**
* All JSON files will be parsed by default,
* but you can also specifically include files
*/
include?: FilterPattern
/**
* All JSON files will be parsed by default,
* but you can also specifically exclude files
*/
exclude?: FilterPattern
/**
* For tree-shaking, properties will be declared as variables, using
* either `var` or `const`.
* @default false
*/
preferConst?: boolean
/**
* Specify indentation for the generated default export
* @default '\t'
*/
indent?: string
/**
* Ignores indent and generates the smallest code
* @default false
*/
compact?: boolean
/**
* Generate a named export for every property of the JSON object
* @default true
*/
namedExports?: boolean
}
// Custom json filter for vite
const jsonExtRE = new RegExp(`\\.json($|\\?)`)
export function jsonPlugin(options: RollupJsonOptions = {}): Plugin {
const filter = createFilter(options.include, options.exclude)
const indent = 'indent' in options ? options.indent : '\t'
return {
name: 'vite:json',
transform(json, id) {
if (!jsonExtRE.test(id) || !filter(id)) return null
try {
const parsed = JSON.parse(json)
return {
code: dataToEsm(parsed, {
preferConst: options.preferConst,
compact: options.compact,
namedExports: options.namedExports,
indent,
}),
map: { mappings: '' },
}
} catch (e) {
const errorMessageList = /[\d]/.exec(e.message)
const position = errorMessageList && parseInt(errorMessageList[0], 10)
const msg = position
? `, invalid JSON syntax found at line ${position}`
: `.`
this.error(`Failed to parse JSON file` + msg, e.idx)
}
},
}
}
import path from 'path'
import { Plugin } from 'vite'
import { createFilter } from '@rollup/pluginutils'
import { camelize, capitalize } from '@vue/shared'
import { UniPluginFilterOptions } from '.'
import { debugEasycom, matchEasycom } from '../../easycom'
const { isBuiltInComponent } = require('@dcloudio/uni-shared')
const EXTNAMES = ['.vue', '.nvue']
const COMPONENTS_PATH = '@dcloudio/uni-h5/dist/uni-h5.esm.js'
const COMPONENTS_STYLE_PATH = '@dcloudio/uni-h5/style/'
export function uniEasycomPlugin(options: UniPluginFilterOptions): Plugin {
const filter = createFilter(options.include, options.exclude)
return {
name: 'vite:uni-easycom',
transform(code, id) {
if (!filter(id)) {
return
}
if (!EXTNAMES.includes(path.extname(id))) {
return
}
debugEasycom(id)
let i = 0
const importDeclarations: string[] = []
code = code.replace(/_resolveComponent\("(.+?)"\)/g, (str, name) => {
if (name && !name.startsWith('_')) {
if (isBuiltInComponent(name)) {
return addSystemImportDeclaration(
importDeclarations,
`__syscom_${i++}`,
name
)
}
const source = matchEasycom(name)
if (source) {
return addImportDeclaration(
importDeclarations,
`__easycom_${i++}`,
source
)
}
}
return str
})
if (importDeclarations.length) {
code = importDeclarations.join('') + code
}
return code
},
}
}
function addSystemImportDeclaration(
importDeclarations: string[],
local: string,
name: string
) {
importDeclarations.push(`import '${COMPONENTS_STYLE_PATH + name + '.css'}';`)
return addImportDeclaration(
importDeclarations,
local,
COMPONENTS_PATH,
capitalize(camelize(name))
)
}
function addImportDeclaration(
importDeclarations: string[],
local: string,
source: string,
imported?: string
) {
importDeclarations.push(createImportDeclaration(local, source, imported))
return local
}
function createImportDeclaration(
local: string,
source: string,
imported?: string
) {
if (imported) {
return `import {${imported} as ${local}} from '${source}';`
}
return `import ${local} from '${source}';`
}
import { FilterPattern } from '@rollup/pluginutils'
import debug from 'debug'
import { UserConfig } from 'vite'
import { UserConfig, Plugin } from 'vite'
import { VitePluginUniResolvedOptions } from '../..'
import { uniPrePlugin } from './pre'
import { uniJsonPlugin } from './json'
import { uniPreCssPlugin } from './preCss'
import { uniPostVuePlugin } from './postVue'
import { uniEasycomPlugin } from './easycom'
const debugPlugin = debug('uni:plugin')
export interface UniPluginFilterOptions extends VitePluginUniResolvedOptions {
......@@ -20,6 +20,10 @@ const uniPrePluginOptions: Partial<UniPluginFilterOptions> = {
/pages\.json\.js$/,
/vite\/dist\/client\/client\.js$/,
/vue&type=/,
/\/@vue\//,
/\/vue-router\//,
/\/vuex\//,
/@dcloudio\/uni-shared/,
UNI_H5_RE,
],
}
......@@ -27,7 +31,7 @@ const uniPreCssPluginOptions: Partial<UniPluginFilterOptions> = {
exclude: [UNI_H5_RE],
}
const uniPostVuePluginOptions: Partial<UniPluginFilterOptions> = {
const uniEasycomPluginOptions: Partial<UniPluginFilterOptions> = {
exclude: [UNI_H5_RE],
}
......@@ -35,30 +39,38 @@ export function resolvePlugins(
config: UserConfig,
options: VitePluginUniResolvedOptions
) {
const jsonIndex = config.plugins!.findIndex(
(plugin) => (plugin as Plugin).name === 'vite:json'
)
config.plugins!.splice(jsonIndex, 1, uniJsonPlugin(options))
const cssIndex = config.plugins!.findIndex(
(plugin) => (plugin as Plugin).name === 'vite:css'
)
config.plugins!.splice(
cssIndex + 1,
const plugins = config.plugins! as Plugin[]
addPlugin(
plugins,
uniPrePlugin(Object.assign(uniPrePluginOptions, options)),
0,
uniPreCssPlugin(Object.assign(uniPreCssPluginOptions, options))
'pre'
)
config.plugins!.unshift(
uniPrePlugin(Object.assign(uniPrePluginOptions, options))
addPlugin(
plugins,
uniPreCssPlugin(Object.assign(uniPreCssPluginOptions, options)),
'vite:css'
)
addPlugin(
plugins,
uniEasycomPlugin(Object.assign(uniEasycomPluginOptions, options)),
'vite:vue'
)
addPlugin(plugins, uniJsonPlugin(options), 'vite:json', 'pre')
if (process.env.DEBUG) {
const vueIndex = config.plugins!.findIndex(
(plugin) => (plugin as Plugin).name === 'vite:vue'
)
config.plugins!.splice(
vueIndex + 1,
0,
uniPostVuePlugin(Object.assign(uniPostVuePluginOptions, options))
)
debugPlugin(config.plugins!.length)
debugPlugin(config.plugins!.map((p) => (p as Plugin).name))
}
}
function addPlugin(
plugins: Plugin[],
plugin: Plugin,
index: string | number,
type: 'pre' | 'post' = 'post'
) {
if (typeof index === 'string') {
index = plugins.findIndex((plugin) => (plugin as Plugin).name === index)
}
return plugins.splice(index + (type === 'pre' ? 0 : 1), 0, plugin)
}
......@@ -3,18 +3,17 @@ import slash from 'slash'
import { Plugin } from 'vite'
import { parse } from 'jsonc-parser'
import { VitePluginUniResolvedOptions } from '../..'
import { jsonPlugin } from './baseJson'
export function uniJsonPlugin(options: VitePluginUniResolvedOptions): Plugin {
const vitePluginJson = jsonPlugin({ preferConst: true, namedExports: true })
const pagesJsonPath = slash(path.resolve(options.inputDir, 'pages.json'))
const pagesJsonJsPath = pagesJsonPath + '.js'
return {
name: 'vite:uni-json',
transform(code, id) {
if (id.startsWith(pagesJsonPath)) {
if (id.startsWith(pagesJsonPath) && !id.startsWith(pagesJsonJsPath)) {
code = JSON.stringify(parse(code))
}
return vitePluginJson.transform!.call(this, code, id)
return code
},
}
}
import debug from 'debug'
import qs from 'querystring'
import { Plugin } from 'vite'
import { createFilter } from '@rollup/pluginutils'
import { UniPluginFilterOptions } from '.'
const debugPostVue = debug('uni:post-vue')
export function uniPostVuePlugin(options: UniPluginFilterOptions): Plugin {
const filter = createFilter(options.include, options.exclude)
return {
name: 'vite:uni-post-vue',
transform(code, id) {
const { filename, query } = parseVueRequest(id)
if (!query.vue && !filter(filename)) {
return
}
if (query.vue) {
debugPostVue(id)
// TODO
// 目前 vite 在 process.env.DEBUG 时,会追加 sourcemap 对象到文件中,如果 source 中包含/**/注释,会报错
// 暂时移除此类请求的 sourcemap
;(this as any).sourcemapChain.length = 0
return code
}
},
}
}
interface VueQuery {
vue?: boolean
src?: boolean
type?: 'script' | 'template' | 'style' | 'custom'
index?: number
lang?: string
}
function parseVueRequest(id: string) {
const [filename, rawQuery] = id.split(`?`, 2)
const query = qs.parse(rawQuery) as VueQuery
if (query.vue != null) {
query.vue = true
}
if (query.src != null) {
query.src = true
}
if (query.index != null) {
query.index = Number(query.index)
}
return {
filename,
query,
}
}
......@@ -9,7 +9,6 @@ const { preJs, preHtml } = require('@dcloudio/uni-cli-shared')
const debugPreJs = debug('uni:pre-js')
const debugPreHtml = debug('uni:pre-html')
const debugPreIgnore = debug('uni:pre-ignore')
const debugPreJsTry = debug('uni:pre-js-try')
const PRE_JS_EXTNAME = ['.js', '.ts', '.json', '.css', '.vue', '.nvue']
......@@ -20,17 +19,14 @@ export function uniPrePlugin(options: UniPluginFilterOptions): Plugin {
name: 'vite:uni-pre',
transform(code, id) {
if (!filter(id)) {
debugPreIgnore(id)
return code
}
debugPreJsTry(id)
const extname = path.extname(id)
const isHtml = PRE_HTML_EXTNAME.includes(extname)
const isJs = PRE_JS_EXTNAME.includes(extname)
const isPre = isHtml || isJs
const hasEndif = isPre && code.includes('#endif')
if (isPre && !hasEndif) {
debugPreJsTry(id)
}
if (isHtml && hasEndif) {
code = preHtml(code)
debugPreHtml(id)
......
......@@ -7,25 +7,26 @@ import { UniPluginFilterOptions } from '.'
const { preJs } = require('@dcloudio/uni-cli-shared')
const debugPre = debug('uni:pre-css')
const debugPreIgnore = debug('uni:pre-css-ignore')
const debugPreTry = debug('uni:pre-css-try')
const cssLangs = `\\.(css|less|sass|scss|styl|stylus|postcss)($|\\?)`
const cssLangRE = new RegExp(cssLangs)
/**
* preprocess css
* @param options
*/
export function uniPreCssPlugin(options: UniPluginFilterOptions): Plugin {
const filter = createFilter(options.include, options.exclude)
return {
name: 'vite:uni-pre-css',
transform(code, id) {
if (!filter(id)) {
debugPreIgnore(id)
return code
}
if (!cssLangRE.test(id)) {
return
}
debugPreTry(id)
if (!code.includes('#endif')) {
debugPreTry(id)
return
}
debugPre(id)
......
import path from 'path'
import debug from 'debug'
import { ViteDevServer } from 'vite'
import { VitePluginUniResolvedOptions } from '..'
const { initEasycom } = require('@dcloudio/uni-cli-shared')
const debugEasycom = debug('uni:easycom')
import { VitePluginUniResolvedOptions } from '..'
import { debugEasycom, initEasycom } from '../easycom'
export function initEasycoms(inputDir: string) {
function initEasycoms(inputDir: string) {
const dirs = ['components'].map((dir) => path.resolve(inputDir, dir))
const easycomOptions = { dirs, rootDir: inputDir }
initEasycom(easycomOptions)
......
import fs from 'fs'
import path from 'path'
import debug from 'debug'
import {
RootNode,
ElementNode,
ElementTypes,
ComponentNode,
TemplateChildNode,
} from '@vue/compiler-core'
interface EasycomOption {
dirs?: string[]
rootDir?: string
......@@ -24,8 +15,6 @@ interface EasycomCustom {
[key: string]: string
}
export * from './autoImport'
export const debugEasycom = debug('uni:easycom')
const easycoms: EasycomMatcher[] = []
......@@ -38,26 +27,10 @@ let hasEasycom = false
function clearEasycom() {
easycoms.length = 0
tags.clear()
easycomsCache.clear()
easycomsInvalidCache.clear()
}
const tags = new Set<string>()
export function isEasycomTag(tag: string) {
return tags.has(tag)
}
export function addEasycomTag(tag: string) {
return tags.add(tag)
}
export const isComponentNode = (
node: RootNode | TemplateChildNode
): node is ComponentNode =>
(node as ElementNode).tagType === ElementTypes.COMPONENT
export function initEasycom({
dirs,
rootDir,
......
......@@ -8,8 +8,6 @@ import { createConfig } from './config'
import { createResolveId } from './resolveId'
import { createConfigResolved } from './configResolved'
import { createConfigureServer } from './configureServer'
const { vueCompilerOptions } = require('@dcloudio/uni-cli-shared')
export interface VitePluginUniOptions {
inputDir?: string
}
......@@ -19,7 +17,7 @@ export interface VitePluginUniResolvedOptions extends VitePluginUniOptions {
devServer?: ViteDevServer
}
export const uniVueCompilerOptions = vueCompilerOptions
export * from './vue'
export default function uniPlugin(
rawOptions: VitePluginUniOptions = {}
......
import { ElementNode, NodeTransform } from '@vue/compiler-core'
import { CompilerOptions } from '@vue/compiler-sfc'
const { isNativeTag } = require('@dcloudio/uni-shared')
const transform: NodeTransform = (node) => {
if (
process.env.UNI_PLATFORM !== 'mp-weixin' &&
(node as ElementNode).tag === 'match-media'
) {
;(node as ElementNode).tag = 'uni-match-media'
}
}
export const uniVueCompilerOptions: CompilerOptions = {
isNativeTag,
nodeTransforms: [transform],
}
export * from './compilerOptions'
......@@ -279,9 +279,9 @@
minimist "^1.2.0"
"@dcloudio/types@^2.0.20":
version "2.0.21"
resolved "https://registry.yarnpkg.com/@dcloudio/types/-/types-2.0.21.tgz#ca56f5962ea1d746e325289933461c84261800fe"
integrity sha512-MCxQNRrVd7AObkZyLDu5719dyO2ZquUHSqacQyZhpGaJMnOse/8rgxjjB94ojtOjek/3Ju05QeyIWkBuc8EhJA==
version "2.0.22"
resolved "https://registry.yarnpkg.com/@dcloudio/types/-/types-2.0.22.tgz#b2be8d512628f36d20297fe8702ef66189276859"
integrity sha512-oRU4m1KDGG8Vbz6ROzl1IRh/wXXnxVPkLCxGMzY8w0cun8/ebna6/6+7Xjhm68ZGeTCn/qmaJnSGAvMhmlhHzw==
"@eslint/eslintrc@^0.3.0":
version "0.3.0"
......@@ -744,9 +744,9 @@
pretty-format "^26.0.0"
"@types/node@*", "@types/node@^14.14.20":
version "14.14.21"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.21.tgz#d934aacc22424fe9622ebf6857370c052eae464e"
integrity sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==
version "14.14.22"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18"
integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==
"@types/node@10.17.13":
version "10.17.13"
......@@ -859,9 +859,9 @@
eslint-visitor-keys "^2.0.0"
"@vitejs/plugin-vue@^1.0.4":
version "1.0.6"
resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.0.6.tgz#698afa5a77a6dcd22cf7757801f46a6f01cdbb53"
integrity sha512-cWJewtxnVVpjlhq6DoZ7VP7sF1jTZYVg66ehslZ0tJANWk1uRiCXdqD8yQ4npZ4XewDICQzK+c+9i3Xsubx59w==
version "1.1.2"
resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.1.2.tgz#64d1f0e0739675f5717015ffb4d861c53af8fe60"
integrity sha512-a5ORYuPsiAO4Kb2blA/x63mDiBQBxEJkbjhVtiv5IP/I7fGfpwXPPGHx9LHD4MedpXp8icngJYMKO0hOwahtmQ==
"@vue/compiler-core@3.0.5", "@vue/compiler-core@^3.0.4":
version "3.0.5"
......@@ -2020,10 +2020,10 @@ error-ex@^1.3.1:
dependencies:
is-arrayish "^0.2.1"
esbuild@^0.8.26:
version "0.8.33"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.33.tgz#4e24ab4e780b08ff5527171bf5a684594c8b56e9"
integrity sha512-2ms/P6Y9zJfopR9dKo2vHzhXKfGSNlquVVoVOF8YnhjuzZVrvManMVBPadBsR/t7jzIkRnwqvxrs7d4f3C3eyg==
esbuild@^0.8.34:
version "0.8.34"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.34.tgz#16b4ac58f74c821d2c5a8c2f0585ca96a38ab4e6"
integrity sha512-tnr0V1ooakYr1aRLXQLzCn2GVG1kBTW3FWpRyC+NgrR3ntsouVpJOlTOV0BS4YLATx3/c+x3h/uBq9lWJlUAtQ==
escape-string-regexp@^1.0.5:
version "1.0.5"
......@@ -2422,9 +2422,9 @@ flat-cache@^3.0.4:
rimraf "^3.0.2"
flatted@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.0.tgz#a5d06b4a8b01e3a63771daa5cb7a1903e2e57067"
integrity sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==
version "3.1.1"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.1.tgz#c4b489e80096d9df1dfc97c79871aea7c617c469"
integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==
for-in@^1.0.2:
version "1.0.2"
......@@ -2472,14 +2472,14 @@ fs-extra@8.1.0:
universalify "^0.1.0"
fs-extra@^9.0.1:
version "9.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
dependencies:
at-least-node "^1.0.0"
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^1.0.0"
universalify "^2.0.0"
fs-extra@~7.0.1:
version "7.0.1"
......@@ -3809,9 +3809,9 @@ lint-staged@^10.5.3:
stringify-object "^3.3.0"
listr2@^3.2.2:
version "3.2.3"
resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.2.3.tgz#ef9e0d790862f038dde8a9837be552b1adfd1c07"
integrity sha512-vUb80S2dSUi8YxXahO8/I/s29GqnOL8ozgHVLjfWQXa03BNEeS1TpBLjh2ruaqq5ufx46BRGvfymdBSuoXET5w==
version "3.3.0"
resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.3.0.tgz#fab51211e4152d88bab7d91e4f7f896b0d9e5ba1"
integrity sha512-G9IFI/m65icgVlifS0wMQnvn35/8VJGzEb3crpE4NnaegQYQOn/wP7yqi9TTJQ/eoxme4UaPbffBK1XqKP/DOg==
dependencies:
chalk "^4.1.0"
cli-truncate "^2.1.0"
......@@ -3821,6 +3821,7 @@ listr2@^3.2.2:
p-map "^4.0.0"
rxjs "^6.6.3"
through "^2.3.8"
wrap-ansi "^7.0.0"
loader-utils@^1.1.0:
version "1.4.0"
......@@ -4944,9 +4945,9 @@ rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.8.2:
estree-walker "^0.6.1"
rollup@^2.35.1:
version "2.37.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.37.0.tgz#5baf631dc224a56d7eb88dd11b20aa28c1e8dc6f"
integrity sha512-cbxuxkMGCQV+TnVh+yZSUerbVb5i8soRydbzHYoMNojgt7MMi+jDLLs24U9HHCssKkwkXmsj+LXcOZMldTbz2w==
version "2.38.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.38.0.tgz#57942d5a10826cb12ed1f19c261f774efa502d2d"
integrity sha512-ay9zDiNitZK/LNE/EM2+v5CZ7drkB2xyDljvb1fQJCGnq43ZWRkhxN145oV8GmoW1YNi4sA/1Jdkr2LfawJoXw==
optionalDependencies:
fsevents "~2.1.2"
......@@ -5681,11 +5682,6 @@ universalify@^0.1.0:
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==
universalify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d"
integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==
universalify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
......@@ -5767,12 +5763,12 @@ verror@1.10.0:
core-util-is "1.0.2"
extsprintf "^1.2.0"
vite@^2.0.0-beta.31:
version "2.0.0-beta.31"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.31.tgz#0ce5f6c496c29f72062f9f0ae70dd6dfb18b0916"
integrity sha512-tHBgSsSp0+dbz8tas6zOj2KbJSKOme62jXN13rk8BZdJEum5FDnwon9+7oas4db3NnVBLnciWa1r8QUNoOZjrA==
vite@^2.0.0-beta.47:
version "2.0.0-beta.47"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.47.tgz#9fb583f731e88001396164ff603df0a0f83279f1"
integrity sha512-SkrdOVHj2T7ZlMhnCBjuPWK3qAMEkM/hz3L8vgOJHTuoRXtwAvh6bjRmLuNszP5ORmN+1sYrgz7MsUNVMxEJLg==
dependencies:
esbuild "^0.8.26"
esbuild "^0.8.34"
postcss "^8.2.1"
resolve "^1.19.0"
rollup "^2.35.1"
......@@ -5784,7 +5780,7 @@ vlq@^0.2.2:
resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26"
integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==
vue-router@^4.0.0-beta.6:
vue-router@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.0.3.tgz#8b26050c88b2dec7e27a88835f71046b365823ec"
integrity sha512-AD1OjtVPyQHTSpoRsEGfPpxRQwhAhxcacOYO3zJ3KNkYP/r09mileSp6kdMQKhZWP2cFsPR3E2M3PZguSN5/ww==
......@@ -5883,6 +5879,15 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册