Skip to content

Commit

Permalink
chore: update postcss-load-config (#880)
Browse files Browse the repository at this point in the history
* chore: update postcss-load-config

* chore: install pnpm@7 in CI

* use pnpm v8

---------

Co-authored-by: EGOIST <hi@egoist.dev>
  • Loading branch information
await-ovo and egoist committed Jun 16, 2023
1 parent cfa6bba commit 68297f7
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -36,7 +36,7 @@
"execa": "^5.0.0",
"globby": "^11.0.3",
"joycon": "^3.0.1",
"postcss-load-config": "^3.0.1",
"postcss-load-config": "^4.0.1",
"resolve-from": "^5.0.0",
"rollup": "^3.2.5",
"source-map": "0.8.0-beta.0",
Expand Down
40 changes: 34 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions test/index.test.ts
Expand Up @@ -1274,4 +1274,31 @@ test('custom inject style function', async () => {
expect(outFiles).toEqual(['input.js', 'input.mjs'])
expect(await getFileContent('dist/input.mjs')).toContain('__custom_inject_style__(`.hello{color:red}\n`)')
expect(await getFileContent('dist/input.js')).toContain('__custom_inject_style__(`.hello{color:red}\n`)')
})


test('should load postcss esm config', async () => {
const { outFiles, getFileContent } = await run(getTestName(), {
'input.ts': `
import './foo.css'
`,
'package.json': `{
"type": "module"
}`,
'postcss.config.js': `
export default {
plugins: {'postcss-simple-vars': {}}
}
`,
'foo.css': `
$color: blue;
.foo {
color: $color;
}
`,
})

expect(outFiles).toEqual(['input.cjs', 'input.css'])
expect(await getFileContent('dist/input.css')).toContain('color: blue;')
})

0 comments on commit 68297f7

Please sign in to comment.