@marko/vite 5.1.2 → 5.1.3
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.
- package/dist/index.mjs +16 -12
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -904,16 +904,31 @@ function markoPlugin(opts = {}) {
|
|
|
904
904
|
if (linked) {
|
|
905
905
|
baseConfig.markoViteLinked = linked;
|
|
906
906
|
}
|
|
907
|
+
const getCJSInteropBabelConfig = () => ({
|
|
908
|
+
...baseConfig.babelConfig,
|
|
909
|
+
plugins: (baseConfig.babelConfig.plugins || []).concat(
|
|
910
|
+
plugin({
|
|
911
|
+
filter: isBuild || isTest ? void 0 : (path7) => !/^\./.test(path7)
|
|
912
|
+
})
|
|
913
|
+
)
|
|
914
|
+
});
|
|
907
915
|
ssrConfig = {
|
|
908
916
|
...baseConfig,
|
|
909
917
|
resolveVirtualDependency,
|
|
910
918
|
output: "html"
|
|
911
919
|
};
|
|
920
|
+
ssrCjsConfig = {
|
|
921
|
+
...ssrConfig,
|
|
922
|
+
babelConfig: getCJSInteropBabelConfig()
|
|
923
|
+
};
|
|
912
924
|
domConfig = {
|
|
913
925
|
...baseConfig,
|
|
914
926
|
resolveVirtualDependency,
|
|
915
927
|
output: "dom"
|
|
916
928
|
};
|
|
929
|
+
if (isTest) {
|
|
930
|
+
domConfig.babelConfig = getCJSInteropBabelConfig();
|
|
931
|
+
}
|
|
917
932
|
hydrateConfig = {
|
|
918
933
|
...baseConfig,
|
|
919
934
|
resolveVirtualDependency,
|
|
@@ -1037,17 +1052,6 @@ function markoPlugin(opts = {}) {
|
|
|
1037
1052
|
},
|
|
1038
1053
|
configResolved(config) {
|
|
1039
1054
|
basePath = config.base;
|
|
1040
|
-
ssrCjsConfig = {
|
|
1041
|
-
...ssrConfig,
|
|
1042
|
-
babelConfig: {
|
|
1043
|
-
...ssrConfig.babelConfig,
|
|
1044
|
-
plugins: (ssrConfig.babelConfig.plugins || []).concat(
|
|
1045
|
-
plugin({
|
|
1046
|
-
filter: isBuild ? void 0 : (path7) => !/^\./.test(path7)
|
|
1047
|
-
})
|
|
1048
|
-
)
|
|
1049
|
-
}
|
|
1050
|
-
};
|
|
1051
1055
|
getMarkoAssetFns = void 0;
|
|
1052
1056
|
for (const plugin2 of config.plugins) {
|
|
1053
1057
|
const fn = plugin2.api?.getMarkoAssetCodeForEntry;
|
|
@@ -1061,7 +1065,7 @@ function markoPlugin(opts = {}) {
|
|
|
1061
1065
|
}
|
|
1062
1066
|
},
|
|
1063
1067
|
configureServer(_server) {
|
|
1064
|
-
ssrConfig.hot = domConfig.hot = true;
|
|
1068
|
+
ssrConfig.hot = ssrCjsConfig.hot = domConfig.hot = true;
|
|
1065
1069
|
devServer = _server;
|
|
1066
1070
|
devServer.watcher.on("all", (type, originalFileName) => {
|
|
1067
1071
|
const fileName = normalizePath(originalFileName);
|