diff --git a/index.html b/index.html index 48ba38fd..eb3d0984 100644 --- a/index.html +++ b/index.html @@ -14,6 +14,9 @@
+ diff --git a/vite.config.mts b/vite.config.mts index 539dd43b..f4428927 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -5,7 +5,9 @@ import { compiler } from "./plugins/compiler.ts"; // import circleDependency from "vite-plugin-circular-dependency"; import dts from "vite-plugin-dts"; import babel from "vite-plugin-babel"; -import { stripGXTDebug } from "./plugins/babel.ts"; +import { stripGXTDebug, processSource } from "./plugins/babel.ts"; +import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill"; +// import { nodeModulesPolyfillPlugin } from 'esbuild-plugins-node-modules-polyfill'; const isLibBuild = process.env["npm_lifecycle_script"]?.includes("--lib"); const withSourcemaps = @@ -88,6 +90,14 @@ export default defineConfig(({ mode }) => ({ "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*", ], }, + optimizeDeps: { + esbuildOptions: { + plugins: [ + // nodeModulesPolyfillPlugin(), + NodeGlobalsPolyfillPlugin({ buffer: true }), + ], + }, + }, build: { sourcemap: withSourcemaps ? "inline" : undefined, lib: isLibBuild @@ -170,6 +180,193 @@ export default defineConfig(({ mode }) => ({ "utils.ts", ), "@lifeart/gxt": path.join(currentPath, "src", "utils", "index.ts"), + "@glimmer/application": path.join( + currentPath, + "src", + "ember-compat", + "glimmer__application.ts", + ), + "ember-svg-jar/helpers/svg-jar": path.join( + currentPath, + "src", + "ember-compat", + "svg-jar.ts", + ), + "@ember/utils": path.join( + currentPath, + "src", + "ember-compat", + "ember__utils.ts", + ), + "@ember/component/helper": path.join( + currentPath, + "src", + "ember-compat", + "ember__component__helper.ts", + ), + "@ember/template": path.join( + currentPath, + "src", + "ember-compat", + "ember__template.ts", + ), + "@ember/debug": path.join( + currentPath, + "src", + "ember-compat", + "ember__debug.ts", + ), + "@ember/modifier": path.join( + currentPath, + "src", + "ember-compat", + "ember__modifier.ts", + ), + "@ember/service": path.join( + currentPath, + "src", + "ember-compat", + "ember__service.ts", + ), + "@ember/destroyable": path.join( + currentPath, + "src", + "ember-compat", + "ember__destroyable.ts", + ), + "@ember/array": path.join( + currentPath, + "src", + "ember-compat", + "ember__array.ts", + ), + "@ember/component/template-only": path.join( + currentPath, + "src", + "ember-compat", + "ember__component__template-only.ts", + ), + "@ember/template-compilation": path.join( + currentPath, + "src", + "ember-compat", + "ember__template-compilation.ts", + ), + "@ember/object/internals": path.join( + currentPath, + "src", + "ember-compat", + "ember__object__internals.ts", + ), + "@ember/application": path.join( + currentPath, + "src", + "ember-compat", + "ember__application.ts", + ), + "@ember/component": path.join( + currentPath, + "src", + "ember-compat", + "ember__component.ts", + ), + "@ember/helper": path.join( + currentPath, + "src", + "ember-compat", + "ember__helper.ts", + ), + "@embroider/macros": path.join( + currentPath, + "src", + "ember-compat", + "embroider__macros.ts", + ), + "@glimmer/component": path.join( + currentPath, + "src", + "ember-compat", + "glimmer__component.ts", + ), + "ember-modifier": path.join( + currentPath, + "src", + "ember-compat", + "ember-modifier.ts", + ), + "@ember/render-modifiers/modifiers/will-destroy": path.join( + currentPath, + "src", + "ember-compat", + "ember-render-modifiers__modifiers__will-destroy.ts", + ), + "@ember/render-modifiers/modifiers/did-insert": path.join( + currentPath, + "src", + "ember-compat", + "ember-render-modifiers__modifiers__did-insert.ts", + ), + "@ember/object": path.join( + currentPath, + "src", + "ember-compat", + "ember__object.ts", + ), + "@embroider/util": path.join( + currentPath, + "src", + "ember-compat", + "embroider__util.ts", + ), + "ember-style-modifier/modifiers/style": path.join( + currentPath, + "src", + "ember-compat", + "ember-style-modifier__modifiers__style.ts", + ), + "@ember/runloop": path.join( + currentPath, + "src", + "ember-compat", + "ember__runloop.ts", + ), + "ember-cli-string-helpers/helpers/classify": path.join( + currentPath, + "src", + "ember-compat", + "ember-cli-string-helpers__helpers__classify.ts", + ), + "@glimmer/tracking": path.join( + currentPath, + "src", + "ember-compat", + "glimmer__tracking.ts", + ), + "ember-set-helper/helpers/set": path.join( + currentPath, + "src", + "ember-compat", + "ember-set-helper__helpers__set.ts", + ), + "@ember/render-modifiers/modifiers/did-update": path.join( + currentPath, + "src", + "ember-compat", + "ember-render-modifiers__modifiers__did-update.ts", + ), + "ember-composable-helpers/helpers/optional": path.join( + currentPath, + "src", + "ember-compat", + "ember-composable-helpers__helpers__optional.ts", + ), + "ember-unique-id-helper-polyfill/helpers/unique-id": path.join( + currentPath, + "src", + "ember-compat", + "ember-unique-id-helper-polyfill.ts", + ), + "ember-composable-helpers": "ember-composable-helpers/addon", }, }, }));