Giter Club home page Giter Club logo

Comments (6)

shenhao98 avatar shenhao98 commented on June 3, 2024

npm i -D @dcloudio/vite-plugin-uni 下载插件

然后vite.config.ts 添加插件

import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
export default defineConfig({
plugins: [
uni()
]
})

from uni-ui.

inksnowhailong avatar inksnowhailong commented on June 3, 2024

但是我运行到小程序时候 将会出现各种资源报错 node_modules并没在小程序那边生成

from uni-ui.

shenhao98 avatar shenhao98 commented on June 3, 2024

但是我运行到小程序时候 将会出现各种资源报错 node_modules并没在小程序那边生成

image
打开小程序点击了工具 -> 构建npm没有

from uni-ui.

18148764734 avatar 18148764734 commented on June 3, 2024

注意 cli 项目默认是不编译 node_modules 下的组件的,导致条件编译等功能失效 ,导致组件异常 需要在根目录创建 vue.config.js 文件 ,增加 @dcloudio/uni-ui 包的编译即可正常

// vue.config.js
module.exports = {
transpileDependencies:['@dcloudio/uni-ui']
}

from uni-ui.

18148764734 avatar 18148764734 commented on June 3, 2024

如果后续还有问题,欢迎reopen后继续提问

from uni-ui.

lanyuzx avatar lanyuzx commented on June 3, 2024

注意 cli 项目默认是不编译 node_modules 下的组件的,导致条件编译等功能失效 ,导致组件异常 需要在根目录创建 vue.config.js 文件 ,增加 @dcloudio/uni-ui 包的编译即可正常

// vue.config.js module.exports = { transpileDependencies:['@dcloudio/uni-ui'] }

vite下怎么配值

from uni-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.