You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`esbuild-plugin-browserslist <https://www.npmjs.com/package/esbuild-plugin-browserslist>`__ sets esbuild's `target <https://esbuild.github.io/api/#target>`__ from `browserslist <https://github.com/browserslist/browserslist>`__'s `defaults <https://browsersl.ist/#q=defaults>`__ query, so that esbuild transpiles any JavaScript syntax that those browsers don't support.
290
+
291
+
Compile Sass with `esbuild-sass-plugin <https://github.com/glromeo/esbuild-sass-plugin>`__, adding vendor prefixes with `Autoprefixer <https://github.com/postcss/autoprefixer>`__ (via `PostCSS <https://postcss.org>`__).
292
+
293
+
Set ``NODE_ENV=production`` in Dockerfiles so that esbuild minifies bundles and omits sourcemaps.
294
+
295
+
With ``bundle: true``, esbuild resolves each ``url()`` in Sass, to copy and content-hash it. However:
296
+
297
+
- An asset from a dependency may not resolve: for example, if the dependency points ``url()`` to a path that isn't built yet. If so, configure your application to build and serve that file (for example, add it to Django's ``STATICFILES_DIRS``), and mark the path as ``external``:
298
+
299
+
.. code-block:: javascript
300
+
301
+
external: ["/static/*"],
302
+
303
+
- If a file is used outside Sass (like images in HTML templates), configure it as above.
304
+
- If a file is exclusive to Sass, point ``url()`` to its source file with a relative path. If the file is a font or image, map its extension to the ``file`` loader, because esbuild assigns no loader to fonts or images by default:
0 commit comments