Support tilde ~ in Sass Transformer
See original GitHub issue🙋 feature request
Support the @import '~path/to/styles.scss' syntax.
🤔 Expected Behavior
It should resolved from node_modules, it was working this way in Parcel v1.
😯 Current Behavior
Error: The @import path "~path/to/styles" is using webpack specific syntax, which isn't supported by Parcel.
To @import files from node_modules, use "path/to/styles"
The error message is actually incorrect. The tilde syntax is not only from Webpack, VScode also supports it: here’s the demo:

💁 Possible Solution
Add the tilde ~ support.
🔦 Context
https://github.com/sweetalert2/sweetalert2-parcel-demo/blob/master/styles.scss
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
Top Results From Across the Web
tilde-sass - npm
A SASS compiler with tilde (~) support for resolving node_modules path and supports new sass' syntax.. Latest version: 1.1.0, ...
Read more >Parcel + SASS: Import from node_modules without tilde ...
it finds the stylesheet to import, but the referenced stylesheet mdc-text-field, that is inside the nodes_modules, tries to load other ...
Read more >@parcel/transformer-sass | Yarn - Package Manager
Add . · New faster resolver supporting absolute and tilde paths, and aliases Details · Content hash output file names in production Details...
Read more >fast-sass-loader - npm Package Health Analysis - Snyk
Learn more about fast-sass-loader: package health score, popularity, security, maintenance, versions and more. ... node-sass-tilde-importer.
Read more >Dependency resolution - Parcel
In addition to the standard dependency specifiers supported across many tools, ... Tilde specifiers start with ~ , and resolve relative to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thank you for the prompt response @DeMoorJasper!
Agree, but it’s widely used, e.g. in packages like https://github.com/sweetalert2/sweetalert2-themes where we
Without
~those files wouldn’t be resolved properly, so~is actually the only one way AFAIK for this approach and IMO should be supported by Parcel v2.I also have the same problem as the underlying library uses the ~ format and thus even though I resolve the file import to absolute path, the file imported has the same issue and parcel compilation is failing.