@marko/vite 4.1.6 → 4.1.8

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.
Files changed (2) hide show
  1. package/dist/index.mjs +13 -8
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -900,21 +900,22 @@ function markoPlugin(opts = {}) {
900
900
  configureServer(_server) {
901
901
  ssrConfig.hot = domConfig.hot = true;
902
902
  devServer = _server;
903
- devServer.watcher.on("all", (type, filename) => {
904
- cachedSources.delete(filename);
903
+ devServer.watcher.on("all", (type, originalFileName) => {
904
+ const fileName = normalizePath(originalFileName);
905
+ cachedSources.delete(fileName);
905
906
  if (type === "unlink") {
906
- entryIds.delete(filename);
907
- transformWatchFiles.delete(filename);
908
- transformOptionalFiles.delete(filename);
907
+ entryIds.delete(fileName);
908
+ transformWatchFiles.delete(fileName);
909
+ transformOptionalFiles.delete(fileName);
909
910
  }
910
911
  for (const [id, files] of transformWatchFiles) {
911
- if (anyMatch(files, filename)) {
912
+ if (anyMatch(files, fileName)) {
912
913
  devServer.watcher.emit("change", id);
913
914
  }
914
915
  }
915
916
  if (type === "add" || type === "unlink") {
916
917
  for (const [id, files] of transformOptionalFiles) {
917
- if (anyMatch(files, filename)) {
918
+ if (anyMatch(files, fileName)) {
918
919
  devServer.watcher.emit("change", id);
919
920
  }
920
921
  }
@@ -1080,7 +1081,11 @@ function markoPlugin(opts = {}) {
1080
1081
  if (!isBuild) {
1081
1082
  const ext = path5.extname(id);
1082
1083
  if (ext === ".cjs" || ext === ".js" && isCJSModule(id)) {
1083
- return cjsToEsm(source);
1084
+ try {
1085
+ return await cjsToEsm(source);
1086
+ } catch {
1087
+ return null;
1088
+ }
1084
1089
  }
1085
1090
  }
1086
1091
  return null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/vite",
3
3
  "description": "A Marko plugin for Vite",
4
- "version": "4.1.6",
4
+ "version": "4.1.8",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/vite/issues",
7
7
  "dependencies": {