mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Use JSON5 for parsing the PostCSS config files Webpack also uses JSON5: https://github.com/vercel/next.js/blob/17f2cb65c2aacc6b52ed6d34e98a839ee465c35d/packages/next/src/lib/find-config.ts#L96 Not sure if a new `Source` is the best way to do this Closes PACK-3103 Closes https://github.com/vercel/next.js/issues/67218 Closes #67221
36 lines
900 B
TypeScript
36 lines
900 B
TypeScript
import { FileRef, nextTestSetup } from 'e2e-utils'
|
|
import { join } from 'path'
|
|
|
|
describe('postcss-config-json', () => {
|
|
const { next } = nextTestSetup({
|
|
files: new FileRef(join(__dirname, 'app')),
|
|
dependencies: {
|
|
autoprefixer: '10.4.19',
|
|
postcss: '8.4.38',
|
|
tailwindcss: '3.4.4',
|
|
},
|
|
packageJson: {
|
|
postcss: {
|
|
plugins: {
|
|
tailwindcss: {},
|
|
autoprefixer: {},
|
|
},
|
|
},
|
|
},
|
|
})
|
|
|
|
it('works with postcss config specified in package.json', async () => {
|
|
let browser = await next.browser('/')
|
|
try {
|
|
const text = await browser.elementByCss('.text-6xl').text()
|
|
expect(text).toMatch(/Welcome to/)
|
|
const cssBlue = await browser
|
|
.elementByCss('#test-link')
|
|
.getComputedCss('color')
|
|
expect(cssBlue).toBe('rgb(37, 99, 235)')
|
|
} finally {
|
|
await browser.close()
|
|
}
|
|
})
|
|
})
|