parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.39k stars 2.26k forks source link

Multiple less files with variable interpolation is not compiling using parcel #8178

Closed ArunaArivazhagan closed 2 years ago

ArunaArivazhagan commented 2 years ago

I have tried to compile 2 less files with Variable declaration using Parcel. Below trying to compile two Less file with variable interpolation approach like "@component-name: banner1;" and "@component-name: "banner2"; and then trying to compile the less and its compiling only the last imported less file.

Find the below git repo and test to replicate the issue.

Clone the below repo https://github.com/ArunaArivazhagan/parecelless from the root directory run "npm install " then run "rpm run build" from the root directory. Once the build success go to theme/dist/theme.css Actually parcel is compiling only the last https://github.com/import css in theme.less. it is not supporting two less import.

Screenshot 2022-06-01 at 11 48 02 AM Screenshot 2022-06-01 at 11 48 19 AM Screenshot 2022-06-01 at 11 48 30 AM
ArunaArivazhagan commented 2 years ago

Any updates on the above issue ? Can anyone help me on this ?

ArunaArivazhagan commented 2 years ago

@mischnic

Can you please help me on this issue ?

mischnic commented 2 years ago

It looks like less variables are global:

If you run npx lessc index.scss (the official less compiler) in that repo, the output is

.banner2 {
  font-weight: bold;
  line-height: 40px;
  margin: 0 auto;
}
.banner2 {
  font-weight: bold;
  line-height: 40px;
  margin: 0 auto;
}