Comments (4)
@tibineagu
@nuxtjs/style-resources
only supports webpack.
If you want to achieve the same thing with vite, use the following options
https://vitejs.dev/config/shared-options.html#css-preprocessoroptions
from style-resources.
@wattanx thanks for the clarification. i implemented the preprocessorOptions and it works decently well.
Thank you!
from style-resources.
Sorry, the README is wrong.
Nuxt 3 does not have buildModules.
Use the modules
option instead.
from style-resources.
Hi @wattanx - unfortunately the module isn't working properly with nuxt 3.
Here is a reproduction repo on stackblitz:
https://stackblitz.com/edit/github-qakexa
package.json
"devDependencies": {
"@nuxt/devtools": "latest",
"@nuxtjs/style-resources": "^2.0.0",
"less": "^4.2.0",
"nuxt": "^3.8.2",
"vue": "^3.3.8",
"vue-router": "^4.2.5"
}
nuxt.config.ts
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
css: ['@/assets/global.less'],
modules: ['@nuxtjs/style-resources'],
styleResources: {
less: ['@/assets/imports/vars.less'],
},
devtools: { enabled: true },
});
The @text-white
LESS variable defined in vars.less
is not accessible in pages/index.vue
- getting this error:
[plugin:vite:css] [less] variable @text-white is undefined
It also seems that the compiler doesn't warn about files listed in styleResources
that don't exist (for example the non-existent-file.less
).
from style-resources.
Related Issues (20)
- SyntaxError: Unexpected token 'export' HOT 4
- Inject variable into JavaScript
- nuxt SCSS can not use liner gradient on production HOT 2
- Renovate breaks builds with each npm bump HOT 3
- Dependency Dashboard
- Module build failed: this.getOptions is not a function at Object.loader HOT 2
- Module @nuxtjs/style-resources not found. How to use devDependencies on production? HOT 3
- Feature Request: Resource Scope
- nuxt3: resolver.resolveModule is not a function HOT 13
- "SassError: expected selector." (mixins)
- Build doesn't fail if file is not found
- hoistUseStatements not working HOT 1
- 无法引用npm安装的依赖包中的变量文件。
- Update docs for Nuxt 3 HOT 2
- Nuxt 3 Support HOT 5
- Nuxt-Bridge support HOT 1
- Nuxt 2 FATAL error when using this HOT 1
- 安装 配置完后
- Unable to make it works HOT 1
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 style-resources.