egoist / egoist/rollup-plugin-postcss

The 'postcss-import plugin cannot parse the @import syntax in LESS styles within Vue files'

Open
#466 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

### It can parse LESS variables but cannot recognize the @import syntax
![error](https://github.com/user-attachments/assets/aec5c429-5106-485c-9c4a-ab737aab5701)

### My part configuration of rollup.config.js:
```
alias({
entries: [{ find: '@', replacement: resolvePath('alias','../src') }]
}),
vue({
css: true,
compileTemplate: true,

}),
postcss({
extensions: ['.css','.less'],
plugins:[
postcssImport({
resolve(id){
console.log(id)
if(id.startsWith('@/')){
const resolvedPath = resolvePath('../src/' + id.slice(2));
console.log(`Resolving @ path: ${id} -> ${resolvedPath}`);
return resolvedPath;
}
return resolvePath('no@',id)
}
})
],
use:[
['less',{
modifyVars: {
hack: `true; @import (reference) "${resolvePath('../src/style/variable.less')}";`
},
javascriptEnabled: true,
}]
],
}),

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.