mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 07:02:28 +03:00
91ef3cc16e
swc_plugin_runner: - Add plugin resolver. - Implement cache for resolver. - Add some integration tests. swc: - Add a cargo feature named `plugin`. - Add an experimental option for plugins. node: - Enable `plugin`. - Add some integration tests.
27 lines
708 B
JavaScript
27 lines
708 B
JavaScript
import swc from '../..';
|
|
|
|
// it("should resolve", async () => {
|
|
// const { code } = await swc.transform(`console.log("Should be removed")`, {
|
|
// jsc: {
|
|
// experimental: {
|
|
// plugins: [
|
|
// ['internal-test', {}]
|
|
// ]
|
|
// }
|
|
// }
|
|
// });
|
|
|
|
// expect(code).toMatch(``)
|
|
// })
|
|
|
|
it("should error if it's not resolved", async () => {
|
|
await expect(swc.transform(`console.log("Should be removed")`, {
|
|
jsc: {
|
|
experimental: {
|
|
plugins: [
|
|
['unknown', {}]
|
|
]
|
|
}
|
|
}
|
|
})).rejects.toThrow("failed to resolve plugin `unknown`");
|
|
}) |