From 0e171fd2ddf578cd8cb30b12c64c14146414797e Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Sat, 13 May 2023 00:15:30 +0200 Subject: [PATCH] [Oxide] Ensure generated `tailwind.config.js` file is formatted properly (#11221) * ensure beginning `\n` is not removed The `\s` regex includes newlines `\n`, but we only want leading spaces to be removed. * update changelog --- CHANGELOG.md | 2 +- src/cli/init/index.js | 2 +- src/oxide/cli/init/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44a3c3c6c..69a7e2cb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `aria-busy` utility ([#10966](https://github.com/tailwindlabs/tailwindcss/pull/10966)) - [Oxide] Use `lightningcss` for nesting and vendor prefixes in PostCSS plugin ([#10399](https://github.com/tailwindlabs/tailwindcss/pull/10399)) - Support `@import "tailwindcss"` using top-level `index.css` file ([#11205](https://github.com/tailwindlabs/tailwindcss/pull/11205)) -- [Oxide] Automatically detect content paths when no `content` configuration is provided ([#11173](https://github.com/tailwindlabs/tailwindcss/pull/11173)) +- [Oxide] Automatically detect content paths when no `content` configuration is provided ([#11173](https://github.com/tailwindlabs/tailwindcss/pull/11173), [#11221](https://github.com/tailwindlabs/tailwindcss/pull/11221)) ### Changed diff --git a/src/cli/init/index.js b/src/cli/init/index.js index ac118549a..b344b5b2e 100644 --- a/src/cli/init/index.js +++ b/src/cli/init/index.js @@ -40,7 +40,7 @@ export function init(args) { // Drop `content` in the oxide engine to promote auto content if (__OXIDE__) { - stubContentsFile = stubContentsFile.replace(/\s*content: \[\],\n/, '') + stubContentsFile = stubContentsFile.replace(/ *content: \[\],\n/, '') } // Change colors import diff --git a/src/oxide/cli/init/index.ts b/src/oxide/cli/init/index.ts index b05138349..ed69be95b 100644 --- a/src/oxide/cli/init/index.ts +++ b/src/oxide/cli/init/index.ts @@ -38,7 +38,7 @@ export function init(args) { // Drop `content` in the oxide engine to promote auto content if (__OXIDE__) { - stubContentsFile = stubContentsFile.replace(/\s*content: \[\],\n/, '') + stubContentsFile = stubContentsFile.replace(/ *content: \[\],\n/, '') } // Change colors import