diff --git a/.changeset/lovely-wasps-compete.md b/.changeset/lovely-wasps-compete.md new file mode 100644 index 0000000000..1b7695896a --- /dev/null +++ b/.changeset/lovely-wasps-compete.md @@ -0,0 +1,5 @@ +--- +"@sit-onyx/nuxt": patch +--- + +fix build issue in nuxt projects using @sit-onyx/nuxt diff --git a/.gitignore b/.gitignore index 3e98556cd6..4b95d3a257 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ blob-report/ storybook-static eslint-results.sarif .nuxt +.output # Development config .env* \ No newline at end of file diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts index 823cbf2742..5f7d26f024 100644 --- a/packages/nuxt/src/module.ts +++ b/packages/nuxt/src/module.ts @@ -10,6 +10,14 @@ export default defineNuxtModule({ }, defaults: {}, setup(_options, nuxt) { + /** + * The calc plugin of cssnano doesn't work with calc constants (https://developer.mozilla.org/en-US/docs/Web/CSS/calc-constant) used within onyx. + * Therefor it needs to be disabled temporarily until they are either no longer used inside onyx or the calc plugin is fixed. + * An issue was raised for inside the calc plugin: https://github.com/postcss/postcss-calc/issues/210 + */ + nuxt.options.postcss.plugins.cssnano ??= {}; + nuxt.options.postcss.plugins.cssnano.preset = ["default", { calc: false }]; + nuxt.options.css.push("sit-onyx/style.css"); Object.keys(onyx)