@lls/vitescripts 1.1.15 → 1.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lls/vitescripts",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "lls vite plugins",
5
5
  "main": "src/index.mjs",
6
6
  "files": [
@@ -1,15 +1,16 @@
1
- const llsCssModuleMacroPlugin = async (cname) => {
1
+ const llsCssModuleMacroPlugin = async (cname, themes = {}) => {
2
2
  const { buildThemeIsFreeMode, buildThemeIsDarkMode, buildThemeIsNotDarkMode } = await import('@lls/lls-kit')
3
3
  const cssMacroTheme = {
4
4
  themeIsFreeMode: buildThemeIsFreeMode(cname),
5
5
  themeIsDarkMode: buildThemeIsDarkMode(cname),
6
- themeIsNotDarkMode: buildThemeIsNotDarkMode(cname)
6
+ themeIsNotDarkMode: buildThemeIsNotDarkMode(cname),
7
+ ...themes
7
8
  }
8
- return {// TODO remove, pending https://github.com/vitejs/vite/pull/14024
9
+ return {
9
10
  enforce: 'pre',
10
11
  transform(src, id) {
11
- if (!id.endsWith('module.css')) {
12
- return src
12
+ if (!/module\.css(\?.*)?$/.test(id)) {
13
+ return undefined
13
14
  }
14
15
  return src
15
16
  .replace(/getTruePx\((.*?)\)/g, 'calc(var(--size-index, 1) * $1 * 1px)')