mirror of
https://github.com/zhigang1992/esbuild.git
synced 2026-04-30 10:22:49 +08:00
allow an empty plugin array in "buildSync" (#499)
This commit is contained in:
@@ -27,6 +27,28 @@ let pluginTests = {
|
||||
}
|
||||
},
|
||||
|
||||
async emptyArray({ esbuild, testDir }) {
|
||||
const input = path.join(testDir, 'in.js')
|
||||
const output = path.join(testDir, 'out.js')
|
||||
await writeFileAsync(input, `export default 123`)
|
||||
await esbuild.build({
|
||||
entryPoints: [input], bundle: true, outfile: output, format: 'cjs', plugins: [],
|
||||
})
|
||||
const result = require(output)
|
||||
assert.strictEqual(result.default, 123)
|
||||
},
|
||||
|
||||
async emptyArrayWithBuildSync({ esbuild, testDir }) {
|
||||
const input = path.join(testDir, 'in.js')
|
||||
const output = path.join(testDir, 'out.js')
|
||||
await writeFileAsync(input, `export default 123`)
|
||||
esbuild.buildSync({
|
||||
entryPoints: [input], bundle: true, outfile: output, format: 'cjs', plugins: [],
|
||||
})
|
||||
const result = require(output)
|
||||
assert.strictEqual(result.default, 123)
|
||||
},
|
||||
|
||||
async basicLoader({ esbuild, testDir }) {
|
||||
const input = path.join(testDir, 'in.js')
|
||||
const custom = path.join(testDir, 'example.custom')
|
||||
|
||||
Reference in New Issue
Block a user