Skip to content

Commit 4db0441

Browse files
committed
throw an error when applying the .group utility (aot mode)
1 parent 0303a12 commit 4db0441

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/util/resolveConfig.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ export default function resolveConfig(configs) {
261261
let allConfigs = [
262262
...extractPluginConfigs(configs),
263263
{
264-
content: [],
265264
prefix: '',
266265
important: false,
267266
separator: ':',
@@ -302,10 +301,10 @@ function normalizeConfig(config) {
302301
content: (() => {
303302
let { content, purge } = config
304303

305-
if (Array.isArray(content)) return content
306-
if (Array.isArray(content?.content)) return content.content
307304
if (Array.isArray(purge)) return purge
308305
if (Array.isArray(purge?.content)) return purge.content
306+
if (Array.isArray(content)) return content
307+
if (Array.isArray(content?.content)) return content.content
309308

310309
return []
311310
})(),

tests/jit/apply.test.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ function run(input, config = {}) {
1111
})
1212
}
1313

14+
function css(templates) {
15+
return templates.join('')
16+
}
17+
1418
test('@apply', () => {
1519
let config = {
1620
darkMode: 'class',
@@ -232,7 +236,7 @@ test('@apply error when using .group utility', async () => {
232236
plugins: [],
233237
}
234238

235-
let css = `
239+
let input = css`
236240
@tailwind components;
237241
@tailwind utilities;
238242
@@ -243,7 +247,7 @@ test('@apply error when using .group utility', async () => {
243247
}
244248
`
245249

246-
await expect(run(css, config)).rejects.toThrowError(
250+
await expect(run(input, config)).rejects.toThrowError(
247251
`@apply should not be used with the 'group' utility`
248252
)
249253
})

0 commit comments

Comments
 (0)