From d5874b049ac9817ca0b15e29d8f6cdc3301d95cc Mon Sep 17 00:00:00 2001 From: Mark Brockhoff Date: Fri, 7 Jun 2024 13:06:25 +0200 Subject: [PATCH 1/3] chore(nuxt): add .output folder to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) 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 From 039447c84d2795dfba0ddedd25d3a3ec4bbfe9e1 Mon Sep 17 00:00:00 2001 From: Mark Brockhoff Date: Fri, 7 Jun 2024 13:08:36 +0200 Subject: [PATCH 2/3] fix(nuxt): disable postcss plugin calc to resolve issue caused by onyx using the calc-constant infinity --- packages/nuxt/src/module.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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) From daa5f71f0dad03391110d691e9ef5383540cde3a Mon Sep 17 00:00:00 2001 From: Mark Brockhoff Date: Fri, 7 Jun 2024 13:14:53 +0200 Subject: [PATCH 3/3] docs(changeset): fix build issue in nuxt projects using @sit-onyx/nuxt --- .changeset/lovely-wasps-compete.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/lovely-wasps-compete.md 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