Comments (9)
For clarification, it's cssImports
.
from esbuild-sass-plugin.
your issue is likely a css import (i.e. not sass) being tried to be resolved by esbuild …I can’t just see that import in formio so if can’t tell more than that… I am happy to help you troubleshoot this but you have to come up with a github repo where you reproduce the issue
from esbuild-sass-plugin.
Yes true, it's a common css import which should recognize the tilde as an alias for the node_modules. The formio file just contains the import statement at the beginning. Here is the repo for reproducing the issue.
from esbuild-sass-plugin.
the issue here is that sass doesn’t call the plugin importer because it’s a css so the import ends in the css that esbuild is trying to bundle and esbuild has no idea how to deal with ~ indeed if you remove ~ from your example url it builds just fine
from esbuild-sass-plugin.
another option for you is to use the precompile in the plugin to change the url and remove the ~
from esbuild-sass-plugin.
I’m on holidays with just an ipad when back I want to try and add another onResolve to the plugin to male life easier in these situations
the idea is the following
var esbuild = require('esbuild');
var esbuildSass = require('esbuild-sass-plugin');
esbuild
.build({
entryPoints: ['./src/formio.scss'],
bundle: true,
outdir: './css',
plugins: [esbuildSass.sassPlugin(),
{name:"temp",setup(build){
build.onResolve({filter:/^~.*css$/},({path})=>{
return {path: require.resolve(path.slice(1))}
})
}}],
})
.catch(() => {
process.exit(1);
});
from esbuild-sass-plugin.
I’m on holidays with just an ipad when back I want to try and add another onResolve to the plugin to male life easier in these situations
the idea is the following
var esbuild = require('esbuild'); var esbuildSass = require('esbuild-sass-plugin'); esbuild .build({ entryPoints: ['./src/formio.scss'], bundle: true, outdir: './css', plugins: [esbuildSass.sassPlugin(), {name:"temp",setup(build){ build.onResolve({filter:/^~.*css$/},({path})=>{ return {path: require.resolve(path.slice(1))} }) }}], }) .catch(() => { process.exit(1); });
Yes no worry, writing the full path works fine for me, so this improvement is not really urgent or even tragic when it's not possible. Enjoy your holidays.
from esbuild-sass-plugin.
@alex-w0 you can upgrade to 2.2.4 and add cssImports: true
to your options
thank you for your example repo!
from esbuild-sass-plugin.
Thanks works great 🚀 I also didn't know that the ~
is deprecated these days ^^
from esbuild-sass-plugin.
Related Issues (20)
- 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
- Add support for latest esbuild version 0.21.0 HOT 3
- Minor docs update - esbuild-sass-plugin contains autoprefixer
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.