Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
shamefully-hoist=true
shamefully-hoist=true
registry=https://registry.npmmirror.com
1 change: 1 addition & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@dcloudio/uni-automator": "3.0.0-4040520250104002",
"@dcloudio/uni-cli-shared": "3.0.0-4040520250104002",
"@dcloudio/vite-plugin-uni": "3.0.0-4040520250104002",
"@uni-helper/vite-plugin-uni-pages": "^0.3.22",
"@uni-helper/vite-plugin-uni-platform": "^0.0.5",
"@uni-ku/root": "workspace:*"
}
Expand Down
3 changes: 3 additions & 0 deletions examples/src/pages-sub/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<div>子包首页</div>
</template>
41 changes: 21 additions & 20 deletions examples/src/pages.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
{
"pages": [
// GENERATED BY UNI-PAGES, PLATFORM: H5 || MP-WEIXIN
{
"path": "pages/index",
"style": {
"navigationBarTitleText": "uni-app"
}
"type": "home"
},
{
"path": "pages/about",
"style": {
"navigationBarTitleText": "uni-app"
}
"type": "page"
},
{
"path": "pages/me",
"style": {
"navigationBarTitleText": "uni-app"
}
"path": "pages/excluded",
"type": "page"
},
// #ifdef H5
{
"path": "pages/excluded",
"style": {
"navigationBarTitleText": "uni-app"
}
"path": "pages/me",
"type": "page"
}
// #endif
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
"subPackages": [
{
"root": "pages-sub",
"pages": [
// GENERATED BY UNI-PAGES, PLATFORM: H5 || MP-WEIXIN
{
"path": "index",
"type": "page"
}
]
}
]
}
32 changes: 32 additions & 0 deletions examples/uni-pages.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by vite-plugin-uni-pages

type _LocationUrl =
"/pages/index" |
"/pages/about" |
"/pages/excluded" |
"/pages-sub/index";

interface NavigateToOptions {
url: _LocationUrl;
}
interface RedirectToOptions extends NavigateToOptions {}

interface SwitchTabOptions {

}

type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;

declare interface Uni {
navigateTo(options: UniNamespace.NavigateToOptions & NavigateToOptions): void;
redirectTo(options: UniNamespace.RedirectToOptions & RedirectToOptions): void;
switchTab(options: UniNamespace.SwitchTabOptions & SwitchTabOptions): void;
reLaunch(options: UniNamespace.ReLaunchOptions & ReLaunchOptions): void;
}

declare module "virtual:uni-pages" {
export type LocationUrl = _LocationUrl;
}
4 changes: 4 additions & 0 deletions examples/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fileURLToPath, URL } from 'node:url'

import Uni from '@dcloudio/vite-plugin-uni'
import UniPages from '@uni-helper/vite-plugin-uni-pages'
import UniPlatform from '@uni-helper/vite-plugin-uni-platform'
import UniKuRoot from '@uni-ku/root'

Expand All @@ -9,6 +10,9 @@ import { defineConfig } from 'vite'
export default defineConfig({
plugins: [
UniPlatform(),
UniPages({
subPackages: ['src/pages-sub'],
}),
UniKuRoot({
enabledVirtualHost: false,
rootFileName: 'KuRoot',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"vite": "^5.0.0"
},
"dependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-4040520250104002",
"@vue/compiler-sfc": "3.4.21",
"chokidar": "^3.6.0",
"jsonc-parser": "^3.3.1"
"chokidar": "^3.6.0"
},
"devDependencies": {
"@antfu/eslint-config": "^3.14.0",
Expand Down
Loading
Loading