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
[bug] @import '~box-sizing-border-box';
not found, while @import '../../node_modules/box-sizing-border-box';
is
#1622
Comments
I think this is a problem with In Feel free to ignore suggestion but an export mapping would be nice: {
"main": "./index.css",
"exports": {
".": "./index.css",
"css": "./index.css",
"scss": "./index.scss"
}
} usage: @import 'box-sizing-border-box';
@import 'box-sizing-border-box/css'; // same as default
@import 'box-sizing-border-box/scss'; |
@kellymears: Thanks! What about Edit: (
So I don't think there are advantages when using these two extra fields. |
@kellymears: I updated that package to use the When I use @import 'box-sizing-border-box'; in the
Have I missed something? |
not 100% sure. i can take a look at it later. but i would think |
Sadly no, the import doesn't work either. Is still something wrong with the package? |
got the same behavior. looked up how bulma does it. this seems to work well (pretty much directly lifted): {
"name": "box-sizing-border-box",
"version": "1.3.0",
"description": "Best practice for setting box-sizing: border-box, taken from css-tricks",
"main": "index.scss",
"unpkg": "index.css",
"style": "index.css"
} you can just edit obviously different build systems will handle this differently, but in the case of bud the json above is resolvable with or without the sass extension. |
@strarsis Could you please provide your package.json or just a list of installed bud extensions? Or try this:
My project:
Then just |
@Phalconline in this case it is actually the package that is the problem (@strasis is the author of the package). I've verified this in 6.3.5. I also think I have solved it in #1622 (comment) so I'm going to go ahead and close this issue. It wasn't really a bud problem, anyway. |
@kellymears, @Phalconline: Thanks for your help! |
Addendum / side notes: The newly added |
Agreement
Describe the issue
When trying to
@import
thebox-sizing-border-box
npm
package in SCSS, it isn't found and the build fails.Only explicitly specifying the path makes the import work correctly:
Expected Behavior
No import issues, entrypoint file of module is found and imported when just using the usual short module import:
@import '~box-sizing-border-box';
.Actual Behavior
Build error as the module cannot be imported.
Steps To Reproduce
box-sizing-border-box
asdependency
:yarn add box-sizing-border-box
.@roots/bud-sass
for enabling SCSS support:yarn add @roots/bud-sass --dev
.app.css
toapp.scss
andeditor.css
toeditor.scss
.@import '~box-sizing-border-box';
to theapp.scss
.yarn build
.Note that the build fails as
~box-sizing-border-box
cannot be found.@import
so a full path is used instead:yarn build
.Note that the build now succeeds as ``
version
6.3.5
What package manager are you using?
yarn classic
version
1.22.19
Related/context
#1014, but the box-sizing-border-box package should have an
export
now.The text was updated successfully, but these errors were encountered: