Skip to content

Commit feb3873

Browse files
committed
Support css content in esbuild plugin
1 parent 2d063b9 commit feb3873

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

packages/esbuild/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function getFiles(buildResult, check) {
2323
let outputs = buildResult.metafile.outputs
2424

2525
for (let key in outputs) {
26-
let outputEntryName = parse(key).name
26+
let outputEntryName = parse(key).base
2727
outputs[outputEntryName] = outputs[key]
2828
outputs[outputEntryName].path = resolve(key)
2929
delete outputs[key]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import './file.js'
2+
import './style.css'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
a {
2+
color: black
3+
}

packages/esbuild/test/index.test.js

+8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ it('uses esbuild to make bundle', async () => {
6464
expect(existsSync(config.checks[0].esbuildOutfile)).toBe(false)
6565
})
6666

67+
it('supports bundles with css', async () => {
68+
let config = {
69+
checks: [{ files: fixture('esm/nonjs.js') }]
70+
}
71+
await run(config)
72+
expect(config.checks[0].size).toBe(49)
73+
})
74+
6775
it('supports ignore', async () => {
6876
let config = {
6977
checks: [{ files: fixture('cjs/big.js'), ignore: ['redux'] }]

0 commit comments

Comments
 (0)