Comments (7)
Thanks for the clarification. Please would you verify I am understanding you correctly, bundling is currently supported for
assert
by using--supported:import-assertions=true
, and in the future (not ready yet) bundling will be supported forwith
by using--supported:import-attributes=true
?
Yes, that's correct. The reason assert
"just works" with esbuild but with
doesn't is because with
can affect path resolution while assert
can't (you can read more about that here). So the bundler basically ignore assert
as it is mostly meaningless, but it can't ignore with
.
from esbuild.
This is happening because esbuild doesn't currently implement bundling CSS imports that use the type: css
import attribute (see #3384).
Did you mean to use --external:*.css
to tell esbuild to not bundle these files?
from esbuild.
when i use assert
keyword to import css, --loader:.css=copy
work perfectly
esbuild style.js --bundle --minify --target=chrome123 --outfile=build/style.js --format=esm --loader:.css=copy
with
is just replacement of assert
for iimport css files
I expect --loader:.css=copy
should work.
I also use --external:*.css
but esbuild throw same error
Importing with a type attribute of "css" is not supported
style.js:1:48:
import styleCss from "./style.css" with { type: "css" };
please add support for with
keyword same as assert
from esbuild.
Ah ok, so this is perhaps a request for with
to work with the copy
loader. That makes sense.
from esbuild.
I have this problem too, I used to use assert { type: "css" }
but now the syntax has been deprecated for with { type: "css" }
. Maybe in addition to the --supported:import-assertions=true
ther should be a --supported:import-with=true
flag?
from esbuild.
The name is import-attributes
not import-with
because the syntax is called import attributes. You can find the full list of feature names that can be used with --supported
in esbuild's documentation: https://esbuild.github.io/api/#supported
However, enabling support for the with
syntax doesn't do anything in this case. The problem is that bundling isn't supported yet, not that the syntax isn't supported.
from esbuild.
The name is
import-attributes
notimport-with
because the syntax is called import attributes. You can find the full list of feature names that can be used with--supported
in esbuild's documentation: https://esbuild.github.io/api/#supportedHowever, enabling support for the
with
syntax doesn't do anything in this case. The problem is that bundling isn't supported yet, not that the syntax isn't supported.
Thanks for the clarification. Please would you verify I am understanding you correctly, bundling is currently supported for assert
by using --supported:import-assertions=true
, and in the future (not ready yet) bundling will be supported for with
by using --supported:import-attributes=true
?
I am super excited and waiting for cause this cause I was forced to move to with
, but now my build step is no longer working correctly. Cheers!
from esbuild.
Related Issues (20)
- [Bug?] Esbuild slow performance due to discarding dir cache when the plugin calls the built-in resolver
- Getting weird esbuild version when using 0.20.2 HOT 3
- ESbuild loader Plugin: Dynamic Imports do not contain "with" information HOT 3
- Dynamic imports with string literal templates are not resolved when using tsconfig paths
- Could not resolve "path", could not resolve "os" HOT 3
- Post install script fails with Expected "0.21.5" but got "0.21.4" HOT 4
- Disable resolving url() in stylesheets? HOT 3
- Request to update Go dependency to fix security vulnerabilities HOT 9
- How to work with core-js ? HOT 5
- Is there a way to preserve string delimiters? HOT 5
- Error: The following dependencies are imported but could not be resolved: main.css HOT 3
- Add `conditions` as a `build.resolve` option
- circular dependency not being detected/reported HOT 3
- esm import cjs package with .node file require return a path string HOT 4
- Minified code performs differently for opening a file browser HOT 1
- esbuild-wasm Unable to set globalName,error: -- window name=__dependency__ HOT 5
- `$configDir` may not be working correctly HOT 2
- npm ci with esbuild on different systems HOT 6
- feature request - annotate function code HOT 2
- Dynamic require of "https" is not supported HOT 2
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.