-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(labware-library): fix labware-library css issue (#16502)
* fix(labware-library): fix labware-library css issue
- Loading branch information
1 parent
0b977af
commit 27a8768
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { Plugin } from 'vite' | ||
|
||
/** | ||
* Plugin to make sure CSS modules do not get tree shaked out of the dist. | ||
* see https://github.com/vitejs/vite/pull/16051 | ||
* | ||
* @returns {Plugin} The Vite plugin object. | ||
*/ | ||
|
||
export const cssModuleSideEffect = (): Plugin => { | ||
return { | ||
name: 'css-module-side-effectful', | ||
enforce: 'post', | ||
transform(_: string, id: string) { | ||
if (id.includes('.module.')) { | ||
return { | ||
moduleSideEffects: 'no-treeshake', // or true, which also works with slightly better treeshake | ||
} | ||
} | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters