@marko/vite 5.3.0 → 5.3.1

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.d.ts CHANGED
@@ -9,5 +9,6 @@ export interface Options {
9
9
  translator?: string;
10
10
  basePathVar?: string;
11
11
  babelConfig?: compiler.Config["babelConfig"];
12
+ isEntry?: (importee: string, importer: string) => boolean;
12
13
  }
13
14
  export default function markoPlugin(opts?: Options): vite.Plugin[];
package/dist/index.mjs CHANGED
@@ -831,6 +831,7 @@ function markoPlugin(opts = {}) {
831
831
  let serverManifest;
832
832
  let basePath = "/";
833
833
  let getMarkoAssetFns;
834
+ let checkIsEntry = () => true;
834
835
  const entryIds = /* @__PURE__ */ new Set();
835
836
  const cachedSources = /* @__PURE__ */ new Map();
836
837
  const transformWatchFiles = /* @__PURE__ */ new Map();
@@ -878,6 +879,9 @@ function markoPlugin(opts = {}) {
878
879
  }
879
880
  runtimeId = opts.runtimeId;
880
881
  basePathVar = opts.basePathVar;
882
+ if (opts.isEntry) {
883
+ checkIsEntry = opts.isEntry;
884
+ }
881
885
  if ("BASE_URL" in process.env && config.base == null) {
882
886
  config.base = process.env.BASE_URL;
883
887
  }
@@ -1168,7 +1172,10 @@ function markoPlugin(opts = {}) {
1168
1172
  importee = importee.slice(0, -importeeQuery.length);
1169
1173
  } else if (!importOpts.scan) {
1170
1174
  if (ssr && linked && importer && importer[0] !== "\0" && (importer !== devEntryFile || normalizePath(importer) !== devEntryFilePosix) && // Vite tries to resolve against an `index.html` in some cases, we ignore it here.
1171
- isMarkoFile(importee) && !isMarkoFile(importer.replace(queryReg, ""))) {
1175
+ isMarkoFile(importee) && !queryReg.test(importer) && !isMarkoFile(importer) && checkIsEntry(
1176
+ normalizePath(path6.resolve(importer, "..", importee)),
1177
+ importer
1178
+ )) {
1172
1179
  importeeQuery = serverEntryQuery;
1173
1180
  } else if (!ssr && isBuild && importer && isMarkoFile(importee) && this.getModuleInfo(importer)?.isEntry) {
1174
1181
  importeeQuery = browserEntryQuery;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/vite",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "description": "A Marko plugin for Vite",
5
5
  "keywords": [
6
6
  "loader",