@wix/astro 2.30.0 → 2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10509,6 +10509,10 @@ function createExtensionViteConfigFactory({ command, config: astroConfig, model
10509
10509
  configFile: false,
10510
10510
  customLogger: astroConfig.customLogger,
10511
10511
  define: { "import.meta.env.WIX_CLIENT_ID": JSON.stringify(model.env.WIX_CLIENT_ID) },
10512
+ experimental: { renderBuiltUrl(filename, { hostId, hostType }) {
10513
+ if (hostType !== "js") return { relative: true };
10514
+ return { runtime: `import.meta.url.replace("${hostId}", "${filename}")` };
10515
+ } },
10512
10516
  optimizeDeps: { include: ["@wix/sdk-context"] },
10513
10517
  publicDir: false,
10514
10518
  resolve: { dedupe: ["@wix/sdk-context"] },
@@ -19982,6 +19986,7 @@ const renderSettingsPanelPath = normalizePath$1(new URL("../dependencies/astro-c
19982
19986
  const reactHmrPath = normalizePath$1(new URL("../dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.js", import.meta.url));
19983
19987
  const customElementHmrPath = normalizePath$1(new URL("../dependencies/astro-custom-elements-extensions/browser-runtime/customElementHmr.js", import.meta.url));
19984
19988
  function viteWrapCustomElementPlugin({ getExtensions, srcDir }) {
19989
+ let config = null;
19985
19990
  const getExtensionForModuleId = (baseId) => {
19986
19991
  return getExtensions().find((extension) => extension.options.id === baseId);
19987
19992
  };
@@ -20000,6 +20005,9 @@ function viteWrapCustomElementPlugin({ getExtensions, srcDir }) {
20000
20005
  };
20001
20006
  return {
20002
20007
  name: "vite-wrap-custom-element-plugin",
20008
+ configResolved(resolvedConfig) {
20009
+ config = resolvedConfig;
20010
+ },
20003
20011
  configureServer: async (server) => {
20004
20012
  server.middlewares.use(async (req, res, next) => {
20005
20013
  ok(req.url != null);
@@ -20058,16 +20066,26 @@ function viteWrapCustomElementPlugin({ getExtensions, srcDir }) {
20058
20066
  }
20059
20067
  const customElement = getExtensionForModuleId(baseId);
20060
20068
  if (customElement) {
20061
- const filePath = join(srcDir, customElement.options.element);
20069
+ const filePath = normalizePath$1(join(srcDir, customElement.options.element));
20070
+ ok(config);
20071
+ if (config.command === "build") return import_lib$1.outdent`
20072
+ import { wrapCustomElement } from '${wrapCustomElementPath}';
20073
+
20074
+ import('${filePath}').then(({ default: CustomElement }) => {
20075
+ wrapCustomElement({
20076
+ customElement: CustomElement,
20077
+ tagName: '${customElement.options.tagName}',
20078
+ });
20079
+ });
20080
+ `;
20062
20081
  return import_lib$1.outdent`
20063
- import CustomElement from '${normalizePath$1(filePath)}';
20064
20082
  import { wrapCustomElement } from '${wrapCustomElementPath}';
20065
20083
  import { customElementHmr } from '${customElementHmrPath}';
20066
20084
 
20067
20085
  if (import.meta.hot) {
20068
20086
  import.meta.hot.accept(() => {});
20069
20087
  import.meta.hot.accept(
20070
- '${normalizePath$1(filePath)}',
20088
+ '${filePath}',
20071
20089
  function({ default: NewCustomElement }) {
20072
20090
  customElementHmr({
20073
20091
  customElement: NewCustomElement,
@@ -20077,9 +20095,11 @@ function viteWrapCustomElementPlugin({ getExtensions, srcDir }) {
20077
20095
  );
20078
20096
  }
20079
20097
 
20080
- wrapCustomElement({
20081
- customElement: CustomElement,
20082
- tagName: '${customElement.options.tagName}',
20098
+ import('${filePath}').then(({ default: CustomElement }) => {
20099
+ wrapCustomElement({
20100
+ customElement: CustomElement,
20101
+ tagName: '${customElement.options.tagName}',
20102
+ });
20083
20103
  });
20084
20104
  `;
20085
20105
  }
@@ -28795,10 +28815,6 @@ function getViteConfig({ createExtensionViteConfig, model }) {
28795
28815
  name: "trusted-backoffice",
28796
28816
  config: {
28797
28817
  build: { rollupOptions: { input: componentEntries } },
28798
- experimental: { renderBuiltUrl(filename, { hostId, hostType }) {
28799
- if (hostType !== "js") return { relative: true };
28800
- return { runtime: `import.meta.url.replace("${hostId}", "${filename}")` };
28801
- } },
28802
28818
  optimizeDeps: { entries: [
28803
28819
  wrapComponentRuntimePath,
28804
28820
  hmrRuntimePath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/astro",
3
- "version": "2.30.0",
3
+ "version": "2.31.0",
4
4
  "dependencies": {
5
5
  "@wix/auth-management": "^1.0.71",
6
6
  "@wix/dashboard": "^1.3.43",
@@ -76,5 +76,5 @@
76
76
  ]
77
77
  }
78
78
  },
79
- "falconPackageHash": "2ce2adc6cddcbcccf5e25de56dd1821dec917dde84b58c5da0f72d41"
79
+ "falconPackageHash": "f6a1a481f80f85fc53e92179d02dd2fd56d2af7f69a8ef2157e78591"
80
80
  }