https://github.com/exogen/stylus-loader-import-wtf
https://github.com/exogen/stylus-loader-import-wtf
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/exogen/stylus-loader-import-wtf
- Owner: exogen
- Created: 2016-05-18T23:04:12.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-18T23:08:39.000Z (about 10 years ago)
- Last Synced: 2025-08-11T04:39:23.643Z (11 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Why are stylus-loader imports insane?
1. Our entry point requires `styles/example-1`.
2. `styles/example-1` requires `./a/base` and `./variables`.
3. `./a/base` requires `./variables` – that is, `styles/a/variables`.
4. `stylus-loader` seems to think both `./variables` imports should resolve to the same file.
5. An error is thrown because we should be getting variables from both files, but we only get one.
6. Prefixing all imports with a `~` still throws an error, but we get the opposite file.
7. It works if one `./variables` is prefixed with `~` and one isn't...but why? And that isn't a general solution.