mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 07:02:28 +03:00
2fedf32747
swc_bundler: - Splitted from spack swc_ecma_parser: - Fix unexpected eof problem which occurs if log level is trace swc_ecma_transforms: - Fix bugs of dce pass spack: - Support cyclic dependencies
23 lines
801 B
JavaScript
23 lines
801 B
JavaScript
const swc = require("../../..");
|
|
const path = require('path');
|
|
|
|
|
|
it('should handle multiple entry in spack.config.js', async () => {
|
|
const result = await swc.bundle(path.join(__dirname, '../../tests/spack/config/spack.config.js'));
|
|
|
|
expect(result.a).toBeTruthy();
|
|
expect(result.a.code.replace('\n', '')).toBe(`console.log('foo');`);
|
|
|
|
expect(result.b).toBeTruthy();
|
|
expect(result.b.code.replace('\n', '')).toBe(`console.log('bar');`);
|
|
});
|
|
|
|
it('should respect .swcrc', async () => {
|
|
const result = await swc.bundle(path.join(__dirname, '../../tests/spack/config-swcrc/spack.config.js'));
|
|
|
|
expect(result.a).toBeTruthy();
|
|
expect(result.a.code).toContain(`require("./common`);
|
|
|
|
expect(result.b).toBeTruthy();
|
|
expect(result.b.code).toContain(`require("./common`);
|
|
}); |