Comments (6)
from unocss-preset-uni.
Add uno.css to your main entry:
// main.ts
import 'uno.css'
from unocss-preset-uni.
原来是uniapp打包app时,打包了2次,加上模式判断就行了
// app打包配置
// uniapp打包app时,打包2次,一次使用 vue 模式打包h5,第2次使用 nvue 模式打包app,
// 第2次打包 unocss 会抛出warn
// entry module not found, have you add import 'uno.css'
in your main entry?
// 导致打包终止
process.env.UNI_COMPILER === 'vue' ? Unocss() : undefined,
from unocss-preset-uni.
from unocss-preset-uni.
uni-app in app mode > > > see this https://github.com/MellowCo/unocss-preset-weapp#uniapp-vue3-vite-app%E6%89%93%E5%8C%85%E4%B8%AD%E6%96%AD 原来是uniapp打包app时,打包了2次,加上模式判断就行了 // app打包配置 // uniapp打包app时,打包2次,一次使用 vue 模式打包h5,第2次使用 nvue 模式打包app, // 第2次打包 unocss 会抛出warn // entry module not found, have you add
import 'uno.css'
in your main entry? // 导致打包终止 process.env.UNI_COMPILER === 'vue' ? Unocss() : undefined,
process.env.UNI_COMPILER === 'vue' ? Unocss() : undefined, // 这样设置后 h5 就不行了 export default ({ command, mode }: ConfigEnv): UserConfigExport => { const env = loadEnv(mode, process.cwd()) log(colors.green('command '), command) log(colors.green('mode '), mode) log(colors.green('env '), env) log(colors.green('process.env.UNI_COMPILER'), process.env.UNI_COMPILER) return defineConfig({ resolve: { alias: { '~/':${path.resolve(__dirname, 'src')}/
, }, }, plugins: [ (command === 'serve' || (command === 'build' && process.env.UNI_COMPILER === 'vue')) ? Unocss() : undefined, // 我暂时时这样解决的
改成这样就行了
// app打包配置
// uniapp打包app时,打包2次,一次使用 vue 模式打包h5,第2次使用 nvue 模式打包app,
// 第2次打包 unocss 会抛出warn,导致打包终止
process.env.UNI_COMPILER !== 'nvue' ? Unocss() : undefined,
from unocss-preset-uni.
uni-app in app mode > > > see this https://github.com/MellowCo/unocss-preset-weapp#uniapp-vue3-vite-app%E6%89%93%E5%8C%85%E4%B8%AD%E6%96%AD 原来是uniapp打包app时,打包了2次,加上模式判断就行了 // app打包配置 // uniapp打包app时,打包2次,一次使用 vue 模式打包h5,第2次使用 nvue 模式打包app, // 第2次打包 unocss 会抛出warn // entry module not found, have you add
import 'uno.css'
in your main entry? // 导致打包终止 process.env.UNI_COMPILER === 'vue' ? Unocss() : undefined,
process.env.UNI_COMPILER === 'vue' ? Unocss() : undefined, // 这样设置后 h5 就不行了 export default ({ command, mode }: ConfigEnv): UserConfigExport => { const env = loadEnv(mode, process.cwd()) log(colors.green('command '), command) log(colors.green('mode '), mode) log(colors.green('env '), env) log(colors.green('process.env.UNI_COMPILER'), process.env.UNI_COMPILER) return defineConfig({ resolve: { alias: { '~/':${path.resolve(__dirname, 'src')}/
, }, }, plugins: [ (command === 'serve' || (command === 'build' && process.env.UNI_COMPILER === 'vue')) ? Unocss() : undefined, // 我暂时时这样解决的改成这样就行了
// app打包配置 // uniapp打包app时,打包2次,一次使用 vue 模式打包h5,第2次使用 nvue 模式打包app, // 第2次打包 unocss 会抛出warn,导致打包终止 process.env.UNI_COMPILER !== 'nvue' ? Unocss() : undefined,
好的,谢谢你
from unocss-preset-uni.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unocss-preset-uni.