mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-22 15:54:09 +00:00
ES2022 Output & whitespace-only minification (#201)
* Change vite output to ES2022 * Add whitespace-only minify using default esbuild Does not work for .es.js output - limitation of vite. Workaround for .es.js involves adding terser & a plugin. * Remove @ts-expect-error from tests * Update vite.config.mts --------- Co-authored-by: Chenlei Hu <huchenlei@proton.me>
This commit is contained in:
@@ -21,7 +21,6 @@ describe("LegacyLGraph Compatibility Layer", () => {
|
||||
});
|
||||
|
||||
test("LegacyLGraph is correctly assigned to LiteGraph", () => {
|
||||
// @ts-expect-error Fixed later in the TS conversion process.
|
||||
expect(LiteGraph.LGraph).toBe(LGraph);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,9 +5,7 @@ import {
|
||||
describe("LGraphNode", () => {
|
||||
it("should serialize position correctly", () => {
|
||||
const node = new LGraphNode("TestNode");
|
||||
// @ts-expect-error Expected - not a TS class yet.
|
||||
node.pos = [10, 10];
|
||||
// @ts-expect-error JS tests in TS format
|
||||
expect(node.pos).toEqual(new Float32Array([10, 10]));
|
||||
expect(node.serialize().pos).toEqual(new Float32Array([10, 10]));
|
||||
});
|
||||
|
||||
@@ -10,8 +10,12 @@ export default defineConfig({
|
||||
fileName: (format) => `litegraph.${format}.js`,
|
||||
formats: ['es', 'umd']
|
||||
},
|
||||
minify: false,
|
||||
sourcemap: true,
|
||||
target: ['es2022'],
|
||||
},
|
||||
esbuild: {
|
||||
minifyIdentifiers: false,
|
||||
minifySyntax: false,
|
||||
},
|
||||
plugins: [
|
||||
dts({
|
||||
@@ -26,4 +30,4 @@ export default defineConfig({
|
||||
'@': '/src'
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user