Comments (3)
I rather not pollute the window scope for that...
How about we make so that you can bundle AppB leaving nonce unresolved and then bundle AppA using define?
In theory, this means you need to have two build target for your AppB one for when you want to use it standalone (if you do) and one for when it has to be re-bundled in AppA.
Suppose you pass in AppB build
sassPlugin({ ..., type: "style", nonce: "window.__whatever__" })
then it leaves __whatever__
accessed globally and unresolved.
You can call it __esbuild_nonce__
if you prefer, the code will just check that the string is a global field access.
At this point you can specify window.__whatever__ = "1234..."
and that would work as you intended,
but you can also just bundle AppA passing define: { "__whatever__": '"1234..."' }
and that avoids polluting the global scope.
from esbuild-sass-plugin.
from esbuild-sass-plugin.
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.