Comments (5)
HI @58bits my plugin already uses resolve for sass imports
esbuild-sass-plugin/lib/plugin.js
Lines 74 to 77 in 4373711
but it might be that your layout doesn't work with require defaults... try and pass an
includePaths
that points to your node_modules, something like this:esbuild-sass-plugin/test/esbuild-sass-plugin.test.ts
Lines 91 to 94 in 4373711
from esbuild-sass-plugin.
Hi @glromeo - thanks very much for taking the time to reply. I've tried updating sassPlugin settings as you've described above, but I'm still getting error: [sass-plugin] Can't find stylesheet to import
I'm new to esbuild, and so it's highly likely I've setup something incorrectly.
I've created a test repo here... https://github.com/58bits/esbuild-test
Can you see anything obviously wrong with this?
from esbuild-sass-plugin.
Hi - I've updated the test repo at https://github.com/58bits/esbuild-test
I've fixed up all @use statements, and changed the build directory and project structure. I'm also using the ~
syntax to specify material modules - and this works, but then there are sub modules, or dependencies that fail.
I'm only attempting to import one component - via src/styles/components/_year-select.scss
And I'm getting the following error:
> src/index.js:1:7: error: [sass-plugin] Can't find stylesheet to import.
╷
23 │ @use '@material/feature-targeting/feature-targeting';
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules/@material/select/_select-helper-text-theme.scss 23:1 @forward
node_modules/@material/select/_index.scss 23:1 @use
src/styles/components/_year-select.scss 2:1 @use
src/styles/style.scss 3:1 root stylesheet
1 │ import './styles/style.scss'
from esbuild-sass-plugin.
According to https://github.com/material-components/material-components-web/tree/master/packages/mdc-select
you have to change your _year-select.scss
to:
@use "../config/config" as *;
@use "~@material/list/mdc-list";
@use "~@material/menu-surface/mdc-menu-surface";
@use "~@material/menu/mdc-menu";
@use "~@material/select/styles";
@use '~@material/select';
.mdc-select--filled:not(.mdc-select--disabled) .mdc-select__anchor {
background-color: $dashboard-panel-background-color;
}
...
then in build.js
just use this setup for esbuild-sass-plugin:
plugins: [sassPlugin({
type: "style",
includePaths: [
path.resolve(__dirname, "node_modules"),
]
})],
from esbuild-sass-plugin.
Oh that's fantastic. It's working. Thank you so much. path.resolve(__dirname, "node_modules"),
what what I needed.
from esbuild-sass-plugin.
Related Issues (20)
- Resolving url() with CSS Modules HOT 2
- Support for bun HOT 2
- postcss Unocss inoperative HOT 2
- When "type" is "style" esbuild ignores url-imported files HOT 1
- How to handle relative `url` paths in 3rd party packages HOT 2
- postcssPresetEnv debug being captured/surpressed? HOT 2
- the src folder maybe needed in published package HOT 1
- `ERROR` Can't find stylesheet to import when I have `@use` in my `scss` files HOT 2
- Sourcemaps for lit-css imports are broken
- 'Could not resolve' error when importing a font file using a relative path in scss HOT 1
- Use `dart-sass` instead of `sass` HOT 6
- npm warning when upgrading to esbuild 0.20.0 HOT 3
- Support for ES-Modules
- Issue with 3.0.0 & Vite HOT 3
- Import of sass files without extension containing multiple dots (like ```common.mixins.scss```) HOT 1
- sass-embedded is not supported on all platforms HOT 3
- Package not compressing/minifying the bundled css files HOT 1
- Feature request: custom styleModule implementation HOT 1
- sass symlink will no longer be created with version 3.x of the plugin
- Builds with `embedded: true` hang forever on Cloudflare Pages worker HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esbuild-sass-plugin.