New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolver-glob not working with .scss files #8921
Comments
Im running into this issue as well. @ImKubass did you ever find a work around?
|
Kinda, but its really hacky, I dont know how to extend parcel functionality, so i have to run script that will deal with globs. Here si code snippet: import fg from "fast-glob"
const sassFile = Bun.file(sourcePath)
const sassFileContent = await sassFile.text()
let sassContentGlobbed = sassFileContent
const IMPORT_REG = /^([ \t]*(?:\/\*.*)?)@import\s+["']([^"']+\*[^"']*(?:\.scss|\.sass)?)["'];?([ \t]*(?:\/[/*].*)?)$/gm
const matches = sassFileContent.match(IMPORT_REG) ?? []
for (const match of matches) {
const glob = `${match.split('"')[1]}.scss`
const files = (await fg(glob)).map((file) => {
return `@import "${file}";`
})
sassContentGlobbed = sassContentGlobbed.replace(match, files.join("\n"))
} Also I have imports like this (without back slashes) @import "src/scss/overrides/*";
@import "src/scss/elements/*";
@import "src/scss/generic/*";
@import "src/scss/utilities/*";
@import "src/components/**/*"; |
@ImKubass Right on thank you! |
This is still an issue. Anything to be done about this aside from a workaround? |
🐛 bug report
resolver-glob not working with SCSS files
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
able to compile globs in
.scss
files. For example:😯 Current Behavior
🔦 Context
Importing
.scss
files one by one works just fine. But its very annoying to import new file every time I create new.scss
file.💻 Code Sample
https://github.com/ImKubass/parcel-scss-glob
Install:
build:
🌍 Your Environment
The text was updated successfully, but these errors were encountered: