🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

uni-read-pages-vite

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uni-read-pages-vite

<!-- * @Author: weisheng * @Date: 2023-03-10 13:13:40 * @LastEditTime: 2023-05-06 20:18:18 * @LastEditors: weisheng * @Description: * @FilePath: \uni-read-pages-vite\README.md * 记得注释 --> # uni-read-pages-vite

latest
npmnpm
Version
0.0.6
Version published
Weekly downloads
81
19.12%
Maintainers
1
Weekly downloads
 
Created
Source

uni-read-pages-vite

参考 uni-read-pages 开发,仅支持使用vite创建的uni-app项目,用于读取pages.json中的配置。

安装

您可以使用 Yarnnpm 安装该软件包(选择一个):

Yarn
yarn add uni-read-pages-vite -D
npm
npm install uni-read-pages-vite --save

开始

配置 vite.config.js 通过 define 注入全局变量 查看文档

配置 vite.config.js

cli创建项目配置
//vite.config.js
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import TransformPages from 'uni-read-pages-vite'

export default defineConfig({
  plugins: [uni()],
  define: {
    ROUTES: new TransformPages().routes
  }
});
hbuilderX创建项目配置
//vite.config.js
import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import TransformPages from 'uni-read-pages-vite'

export default defineConfig({
  plugins: [uni()],
  define: {
    ROUTES: new TransformPages(__dirname).routes
  }
});

Keywords

uni-app

FAQs

Package last updated on 06 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts