-
#1665
352fc19Thanks @askoufis! - Assets used in CSS generated by the plugin will now respect thebuild.assetsInlineLimitVite configuration option -
Updated dependencies [
a440470,352fc19]:- @vanilla-extract/[email protected]
- @vanilla-extract/[email protected]
- Updated dependencies []:
- @vanilla-extract/[email protected]
- @vanilla-extract/[email protected]
- Updated dependencies [
46ef1db,ad5a08b]:- @vanilla-extract/[email protected]
- @vanilla-extract/[email protected]
-
#1624
50f1234Thanks @BPScott! - Include^7.0.0invitedependency range -
Updated dependencies [
50f1234]:- @vanilla-extract/[email protected]
-
#1614
4e92cceThanks @askoufis! - Add newinlineCssInDevoption tounstable_modeconfiguration propertySetting
unstableMode: 'inlineCssInDev'will result in all CSS generated by Vanilla Extract being inlined into astyleelement at the top of the documenthead. This feature is useful for preventing FOUC (Flash of Unstyled Content) when server-rendering your initial HTML. Without this, callingssrLoadModuleon your server entrypoint will not include the CSS in the HTML, leading to a FOUC when the client-side JavaScript takes over.Note that CSS will only be inlined in development mode. Production builds are unaffected by this setting.
EXAMPLE USAGE:
// vite.config.ts import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; export default { plugins: [ vanillaExtractPlugin({ unstable_mode: 'inlineCssInDev' }) ] };
- Updated dependencies [
4e92cce]:- @vanilla-extract/[email protected]
-
#1617
f4bd196Thanks @askoufis! - Don't watch files or invalidate VE modules during SSRFixes a bug where a dependent of a Vanilla Extract module could be evaulated multiple times during
ssrLoadModule, potentially causing bugs with singleton variables such as React context.
-
#1610
2b0be1bThanks @askoufis! - Revert "Improve ESM package entrypoints (#1597)" to fixNamed export not founderror when importing ESM entrypoints -
Updated dependencies [
2b0be1b]:- @vanilla-extract/[email protected]
- @vanilla-extract/[email protected]
- Updated dependencies [
9bf58ee]:- @vanilla-extract/[email protected]
-
Updated dependencies [
a7fccf8]:- @vanilla-extract/[email protected]
- @vanilla-extract/[email protected]
-
#1592
35d6b3fThanks @askoufis! - Disable the compiler's file watcher during builds -
Updated dependencies [
35d6b3f]:- @vanilla-extract/[email protected]
-
#1583
6488e28Thanks @askoufis! - Ignore VitebaseconfigFixes a bug where imported asset URLs would be transformed by the compiler when setting the
baseoption in Vite, resulting in incorrect resolution and bundling of these assets during the build process. -
Updated dependencies [
6488e28]:- @vanilla-extract/[email protected]
- @vanilla-extract/[email protected]
- Updated dependencies [
965fd03]:- @vanilla-extract/[email protected]
- @vanilla-extract/[email protected]
-
#1537
7810b7cThanks @askoufis! - Change the plugin name from"vanilla-extract"to the more conventional"vite-plugin-vanilla-extract" -
#1529
d5b6e70Thanks @askoufis! - Updatevitepeer dependency range to^5.0.0 || ^6.0.0BREAKING CHANGE: Vite 4 is no longer supported. Please upgrade to at least Vite 5.
-
#1537
7810b7cThanks @askoufis! - BREAKING CHANGE: User-configured vite plugins are no longer forwarded through to the Vanilla Extract compiler by default. This should not affect most consumers.Previously, all vite plugins except for a select few incompatible plugins were forwarded through. This resulted in a constant game of whack-a-mole as new plugins were added to the list of incompatible plugins as issues were discovered.
Framework-specific plugins, as well as plugins that handle assets and build output, tend not to be relevant to Vanilla Extract code, and in some cases cause more harm than good.
For that reason, in this release only the
vite-tsconfig-pathsplugin is fowarded through by default. This is a relatively common plugin that is know to be compatible with the Vanilla Extract compiler.In most cases users should not need to forward any additional plugins through to the Vanilla Extract compiler. However, if such a case arises, a plugin filter function can be provided via the
unstable_pluginFilteroption:// vite.config.ts import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; import { vitePluginFoo } from 'vite-plugin-foo'; export default defineConfig({ plugins: [ vitePluginFoo(), vanillaExtractPlugin({ // Only forward the `vite-plugin-foo` plugin through to the Vanilla Extract compiler unstable_pluginFilter: ({ name, mode }) => plugin.name === 'vite-plugin-foo' }) ] });
When providing a plugin filter function, the
vite-tsconfig-pathsplugin will no longer be forwarded through by default. If you wish to forward this plugin, you must include it in your filter function.NOTE: The
unstable_pluginFilterAPI is considered unstable and may be changed or removed without notice in a future non-major version.
- Updated dependencies [
d5b6e70,d5b6e70]:- @vanilla-extract/[email protected]
-
#1536
a8248beThanks @askoufis! - Consume compiler API from new@vanilla-extract/compilerpackage instead of@vanilla-extract/integration -
Updated dependencies [
5f66abb,a8248be,a8248be,ec0b024,a8248be]:- @vanilla-extract/[email protected]
- @vanilla-extract/[email protected]
- Updated dependencies []:
- @vanilla-extract/[email protected]
- Updated dependencies []:
- @vanilla-extract/[email protected]
- #1492
1fd348aThanks @kube! - Filter outreact-routerVite plugin when creating thevite-nodecompiler
-
#1482
30c0305Thanks @askoufis! - Fixes a bug where Vanilla Extract files with extensions other thancss.tswere not being invalidated during HMR -
Updated dependencies []:
- @vanilla-extract/[email protected]
- Updated dependencies [
96dd466127374b21ad7e48e5dd168a03a96af047]:- @vanilla-extract/[email protected]
- Updated dependencies [
6668e9e069276b0fd9ccd9668403b4eeb840a11b,61878f5fb21a33190ef242551c639e216ba4748a]:- @vanilla-extract/[email protected]
- #1438
765b85610207992693a822fb3b1aec995ab48409Thanks @ArrayKnight! - Fixes a bug where changes to.css.tsdependencies of top-level.css.tsfiles would not generate new CSS
- Updated dependencies [
124c31c2d9fee24d937c4626cec524d527d4e55e]:- @vanilla-extract/[email protected]
-
#1395
8d1731b44f8e93153c8087a533e0f9b2ed99767cThanks @askoufis! - Fixes a bug that made the plugin incompatible with frameworks that use custom config files -
Updated dependencies []:
- @vanilla-extract/[email protected]
-
#1335
b8a99e4980710a34692034d5da43e584edbc3d17Thanks @askoufis! - Addtypesfield topackage.json -
Updated dependencies [
b8a99e4980710a34692034d5da43e584edbc3d17]:- @vanilla-extract/[email protected]
- #1399
ce738ba9e9a6b5c72cc7868bed724c816ca3cc4eThanks @askoufis! - Ensure the compiler instance is re-used between builds
-
#1397
2232ef4aa0b8410ff791626a951a15cc03dfbb09Thanks @askoufis! - Fixes a bug that was causing output CSS files to not update during watch mode -
Updated dependencies [
606660618dc5efa6c529f77cebf9d2b8dc379dbd,e58cf9013c6f6cdfacb2a7936b3354e71138e9fb]:- @vanilla-extract/[email protected]
-
#1369
05ef2f0Thanks @askoufis! - Fixes a bug where an internal Remix plugin would throw an error inside thevite-nodecompiler -
#1368
90f0315Thanks @askoufis! - Update@vanilla-extract/integrationdependencyThis fixes a bug where APIs that used the
walkObjectutility (e.g.createTheme) would fail when used with module namespace objects insidevite-node. This was due to the previous implementation using the input object'sconstructorto initialize a clone, which does not work with module namespace objects because they do not have aconstructorfunction. -
Updated dependencies [
c8aefe0]:- @vanilla-extract/[email protected]
- #1353
94d5f06Thanks @himself65! - Movevite-nodecompiler creation to a more appropriate plugin hook to ensure correct cleanup of resources
-
#1314
e8a6850Thanks @mrm007! - Resolve and pass a new copy of the Vite config to the vite-node compilerPreviously, we were passing the same Vite config object to the vite-node compiler. This was causing compatibility issues with other plugins, such as Vitest and Remix.
-
Updated dependencies [
e8a6850]:- @vanilla-extract/[email protected]
-
#1309
fdafb6dThanks @mrm007! - Correctly resolve module paths when using Vite plugins that affect module resolution, such asvite-tsconfig-paths -
#1308
20e33a5Thanks @mrm007! - Don't pass Remix Vite plugin to the vite-node compilerRemix throws an error if it's loaded without a config file, which is what we do when we initialise the vite-node compiler.
-
Updated dependencies [
fdafb6d]:- @vanilla-extract/[email protected]
-
#1304
545bf82Thanks @fukumasuya! - Pass Viteresolveconfig to vite-node compilerThe plugin passes through the project's Vite
resolveconfig to the vite-node compiler, which will be used for resolving imports. These options includeresolve.alias,resolve.dedupe,resolve.conditions,resolve.mainFields,resolve.extensions, and others. -
Updated dependencies [
545bf82]:- @vanilla-extract/[email protected]
-
#1300
d0b84f6Thanks @mrm007! - Skip loading plugins added by Vitest -
#1297
85e1131Thanks @mrm007! - Correctly resolve the user's Vite plugins
-
#1264
e531c41Thanks @mrm007! - The Vite plugin now uses a newer, faster, Vite-based compiler by default.The new compiler uses
vite-nodeto parse and extract CSS from.css.tsfiles. This comes with all the benefits of using Vite, faster builds and the ability to use Vite plugins.The new compiler has been used in Remix ever since support for Vanilla Extract was introduced.
-
#1264
e531c41Thanks @mrm007! - The behaviour previously known asemitCssInSsrhas been turned on by default. TheemitCssInSsroption has been removed.This means that the CSS emitted by the plugin is now processed by Vite, so the plugin no longer needs to resolve PostCSS plugins and process the CSS output itself.
-
#1264
e531c41Thanks @mrm007! - TheesbuildOptionsoption has been removed as we are no longer using esbuild internally
-
Updated dependencies [
e531c41,e531c41]:- @vanilla-extract/[email protected]
-
#1291
00af971Thanks @mrm007! - Update dependency@vanilla-extract/integration -
#1254
f373d7fThanks @EvgenNoskov! - Allow hyphens in class names when using a custom identifier
-
#1262
610c50bThanks @mrm007! - Update Babel config to target Node.js 14 -
#1262
610c50bThanks @mrm007! - Lazy load Vite to avoid the CJS warning -
Updated dependencies [
610c50b,610c50b]:- @vanilla-extract/[email protected]
- #1250
bc349fdThanks @kosmotema! - Prevent unnecessary module invalidations when using PostCSS
-
#1239
1791df2Thanks @markdalgleish! - DefaultemitCssInSsrtotruewhen Remix Vite plugin is present -
#1240
2cad138Thanks @mrm007! - Add Vite 5 to peer dependencies -
Updated dependencies [
fd5d9fc]:- @vanilla-extract/[email protected]
- #1231
cdd5150Thanks @mrm007! - Bumppostcss-load-configto enable loading PostCSS configs defined as ES Modules
- #1160
e391baeThanks @SombreroElGringo! - Users can now provide a custom identifier hashing function
- #1093
8bed6f5Thanks @kosmotema! - Fix HMR in Windows by normalizing paths fromwatchFiles
- #1066
0d0ea39Thanks @askoufis! - Fix stale emitted CSS in SSR mode by invalidating all modules related to a file
-
#989
669a61fThanks @michaeltaranto! - AddemitCssInSsroptionProvides the ability to opt in to emitting CSS during SSR.
// vite.config.js import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; export default { plugins: [ vanillaExtractPlugin({ emitCssInSsr: true }) ] };
-
#952
a677c46Thanks @endigma! - Whitelistvite-plugin-svelteto enable emitting CSS on the server -
Updated dependencies [
eea3c7d,cc60aa8]:- @vanilla-extract/[email protected]
- Updated dependencies [
2d08761]:- @vanilla-extract/[email protected]
- #845
b6aa8b6Thanks @tom-sherman! - Adds vite v3 to peer dependencies
-
#827
9cfb9a1Thanks @mattcompiles! - Add automatic debug IDsAutomatic debug IDs allow your styles and other identifiers (e.g. CSS Vars, keyframes, etc) to have names that more closely reflect your source code when in development. This makes it easier to understand how the CSS output links to your source code.
// styles.css.ts // redBox ~= 'styles_redBox_asdfgj' const redBox = style({ background: 'red' });
- Updated dependencies [
9cfb9a1,9cfb9a1,9cfb9a1]:- @vanilla-extract/[email protected]
- #825
ef905c3Thanks @markdalgleish! - Add experimental support for SolidStart
- #796
ee83020Thanks @mechairoi! - Add experimental support for Astro
- #781
4fb9a2cThanks @benjervis! - Adds a check for the existence of import.meta.hot before attempting to add an event listener to inject styles
- #751
8c4f71bThanks @frandiox! - Add experimental support for React Server Components
- #729
02ea735Thanks @danielroe! - Generate CSS and not HMR code if vite server is present in production mode
- #668
e373b51Thanks @AndrewLeedham! - Add esbuild configurations to vite/esbuild/rollup plugins
- Updated dependencies [
e373b51]:- @vanilla-extract/[email protected]
- #716
9b6f3eaThanks @mattcompiles! - Fix unresolvable imports inside monorepos
- #707
162b66fThanks @AndrewLeedham! - Fix styles not updating in dev mode
-
#673
f6d5337Thanks @mattcompiles! - Fix issue where.css.tsfiles with the same file path from other packages could have identifier collisions -
Updated dependencies [
f6d5337]:- @vanilla-extract/[email protected]
-
#647
3c9b7d9Thanks @mattcompiles! - Use more realistic file paths for virtual CSS files -
Updated dependencies [
3c9b7d9]:- @vanilla-extract/[email protected]
- #628
6fa65adThanks @mattcompiles! - Fix style imports from parent directories
- Updated dependencies [
bec1cd8,e1550da,e1550da]:- @vanilla-extract/[email protected]
-
#543
2c7abb1Thanks @mattcompiles! - Ensure code is compatible with node 12 -
Updated dependencies [
2c7abb1]:- @vanilla-extract/[email protected]
-
#530
0d7f912Thanks @benjervis! - Fix compatibility issues with [email protected]Vite 2.7 introduced some breaking changes around the way SSR was indicated in plugins. The plugin has been updated to handle both the old and new formats, so it should support both 2.7 forward, as well as previous versions.
-
#517
64791f3Thanks @benjervis! - Add postcss processing to the pluginVite supports postcss processing as a built in feature, but that's lost in dev mode with vanilla-extract because there are no actual css files for vite to pick up.
The vite plugin now manually runs postcss over the generated css in serve mode, if any postcss config was found.
- Updated dependencies [
64791f3]:- @vanilla-extract/[email protected]
- #470
a6383e8Thanks @Katarina-UBCO! - Prefix.vanilla.jsand.vanilla.cssvirtual modules withvirtual:vanilla-extract:.
- #422
4e5ba05Thanks @mattcompiles! - Remove thedevStyleRuntimeoption
-
#422
4e5ba05Thanks @mattcompiles! - Fix HMR for pre-existing CSSPreviously, styles would not hot reload correctly when returning to a previously cached version
-
#409
a9c5cb7Thanks @benjervis! - Fix plugin for watch mode.The vite plugin previously relied on a one to one matching of resolve to load calls, and would clean up the CSS stored in memory after it was loaded.
This isn't true in
--watchmode, as the same file can be loaded on the rebuild without having to be resolved, which the plugin now handles.
-
#409
a9c5cb7Thanks @benjervis! - Update the "vanilla-extract" devStyleRuntime option.When using the vanilla browser runtime in vite, it now operates on a new model where a .css.js file is generated, that uses @vanilla-extract/css/injectStyles to add the css to the browser.
This allows for hot reloading of styles, and makes styles a bit easier to debug at dev time (because they're actually visible).
-
#409
a9c5cb7Thanks @benjervis! - Handle vite 2.6.As of vite 2.6 and greater,
?usedgets appended to css imports, which causes the file imports to be not what we expected.This caused mismatching classnames in the vite plugin, and it caused the babel plugin to not add filescopes when it should have.
-
#409
a9c5cb7Thanks @benjervis! - Automatically optimize deps.When using the new vanilla browser runtime, the new
injectStylesdependency gets injected at runtime, so vite can't discover it ahead of time and pre-bundle it.The plugin will now add the dependency to optimizeDeps if the vanilla runtime is being used so that it's optimized up front. It also ensures that some relevant vanilla packages are externalised in SSR mode.
-
Updated dependencies [
a9c5cb7]:- @vanilla-extract/[email protected]
-
#398
63f4ed0Thanks @benjervis! - Fixes a bug with vite where "?used" is appended to the file path of css files.This could cause different class name hashes to be generated between SSR and client builds. This was introduced in vite 2.6.0.
-
#393
2f379f1Thanks @mattcompiles! - Fix compilation errors in Vite 2.6 -
Updated dependencies [
2f379f1]:- @vanilla-extract/[email protected]
-
#373
a55d2cfThanks @mattcompiles! - AdddevStyleRuntimeoption to allow switching between dev style runtimesThe built-in Vite dev style runtime (what adds styles to the page when running
vite serve) doesn't seem to clean up old styles as expected. PassingdevStyleRuntime: 'vanilla-extract'will instead use vanilla-extract's browser runtime. This pushes all style creation in development to the browser, but may give a better HMR experience.
-
#341
0b743e7Thanks @mattcompiles! - Refactor SSR file scoping to use centralisedaddFileScopeimplementation -
Updated dependencies [
50bae14,0b743e7]:- @vanilla-extract/[email protected]
- #327
73b55f8Thanks @benjervis! - Fix bug where precompiled .css.ts files (.css.js) were treated differently in SSR mode.
-
#323
1e7d647Thanks @mattcompiles! - Formatting of identifiers (e.g. class names, keyframes, CSS Vars, etc) can now be configured via theidentifiersoption which accepts eithershortordebug.shortidentifiers are a 7+ character hash. e.g.hnw5tz3debugidentifiers contain human readable prefixes representing the owning filename and a potential rule level debug name. e.g.somefile_mystyle_hnw5tz3
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; vanillaExtractPlugin({ identifiers: 'short' });
BREAKING CHANGE
Previously identifiers were formatted as
shortwhenprocess.env.NODE_ENVwas set to "production". By default, they will now be formatted according to Vite's mode config.
- Updated dependencies [
1e7d647]:- @vanilla-extract/[email protected]
-
#311
416eb9aThanks @mattcompiles! - In SSR mode, move to runtime evaluation of vanilla-extract filesThis unlocks the potential for CSS extraction on the server.
- #270
fe19158Thanks @yyx990803! - Fix watching of modules imported by.css.tsfiles
-
#259
b8a6441Thanks @markdalgleish! - Allow the result ofcomposeStylesto be used in selectorsWhen style compositions are used in selectors, they are now assigned an additional class so they can be uniquely identified. When selectors are processed internally, the composed classes are removed, only leaving behind the unique identifier classes. This allows you to treat them as if they were a single class within vanilla-extract selectors.
import { style, globalStyle, composeStyles } from '@vanilla-extract/css'; const background = style({ background: 'mintcream' }); const padding = style({ padding: 12 }); export const container = composeStyles( background, padding ); globalStyle(`${container} *`, { boxSizing: 'border-box' });
- Updated dependencies [
b8a6441]:- @vanilla-extract/[email protected]
- #171
84a8611Thanks @mattcompiles! - Release v1
- Updated dependencies [
84a8611]:- @vanilla-extract/[email protected]
-
#96
697a233Thanks @mattcompiles! - Change vite-plugin to be a named exportBREAKING CHANGE
-import vanillaExtractPlugin from '@vanilla-extract/vite-plugin'; +import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; // vite.config.js export default { plugins: [vanillaExtractPlugin()] }