@marko/vite 2.2.6 → 2.2.7

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.js CHANGED
@@ -106,6 +106,7 @@ function markoPlugin(opts = {}) {
106
106
  output: "hydrate"
107
107
  });
108
108
  let root;
109
+ let devEntryFile;
109
110
  let isBuild = false;
110
111
  let isSSRBuild = false;
111
112
  let devServer;
@@ -120,6 +121,7 @@ function markoPlugin(opts = {}) {
120
121
  async config(config, env) {
121
122
  compiler ?? (compiler = await import(opts.compiler || "@marko/compiler"));
122
123
  root = config.root || process.cwd();
124
+ devEntryFile = import_path.default.join(root, "index.html");
123
125
  isBuild = env.command === "build";
124
126
  isSSRBuild = isBuild && linked && Boolean(config.build.ssr);
125
127
  if (!registeredTag) {
@@ -210,7 +212,7 @@ function markoPlugin(opts = {}) {
210
212
  let importeeQuery = getMarkoQuery(importee);
211
213
  if (importeeQuery) {
212
214
  importee = importee.slice(0, -importeeQuery.length);
213
- } else if (ssr && linked && importer && isMarkoFile(importee) && !isMarkoFile(importer.replace(queryReg, ""))) {
215
+ } else if (ssr && linked && importer && importer !== devEntryFile && isMarkoFile(importee) && !isMarkoFile(importer.replace(queryReg, ""))) {
214
216
  importeeQuery = serverEntryQuery;
215
217
  } else if (!ssr && isBuild && importer && isMarkoFile(importee) && ((_a2 = this.getModuleInfo(importer)) == null ? void 0 : _a2.isEntry)) {
216
218
  importeeQuery = browserEntryQuery;
package/dist/index.mjs CHANGED
@@ -69,6 +69,7 @@ function markoPlugin(opts = {}) {
69
69
  output: "hydrate"
70
70
  });
71
71
  let root;
72
+ let devEntryFile;
72
73
  let isBuild = false;
73
74
  let isSSRBuild = false;
74
75
  let devServer;
@@ -83,6 +84,7 @@ function markoPlugin(opts = {}) {
83
84
  async config(config, env) {
84
85
  compiler ?? (compiler = await import(opts.compiler || "@marko/compiler"));
85
86
  root = config.root || process.cwd();
87
+ devEntryFile = path.join(root, "index.html");
86
88
  isBuild = env.command === "build";
87
89
  isSSRBuild = isBuild && linked && Boolean(config.build.ssr);
88
90
  if (!registeredTag) {
@@ -173,7 +175,7 @@ function markoPlugin(opts = {}) {
173
175
  let importeeQuery = getMarkoQuery(importee);
174
176
  if (importeeQuery) {
175
177
  importee = importee.slice(0, -importeeQuery.length);
176
- } else if (ssr && linked && importer && isMarkoFile(importee) && !isMarkoFile(importer.replace(queryReg, ""))) {
178
+ } else if (ssr && linked && importer && importer !== devEntryFile && isMarkoFile(importee) && !isMarkoFile(importer.replace(queryReg, ""))) {
177
179
  importeeQuery = serverEntryQuery;
178
180
  } else if (!ssr && isBuild && importer && isMarkoFile(importee) && ((_a2 = this.getModuleInfo(importer)) == null ? void 0 : _a2.isEntry)) {
179
181
  importeeQuery = browserEntryQuery;
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": "2.2.6",
4
+ "version": "2.2.7",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/vite/issues",
7
7
  "dependencies": {
@@ -11,29 +11,36 @@
11
11
  "htmlparser2": "^7.2.0"
12
12
  },
13
13
  "devDependencies": {
14
- "@commitlint/cli": "^16.0.1",
14
+ "@commitlint/cli": "^16.1.0",
15
15
  "@commitlint/config-conventional": "^16.0.0",
16
- "@marko/compiler": "^5.17.6",
17
- "@types/mocha": "^9.0.0",
18
- "@types/node": "^17.0.6",
19
- "@typescript-eslint/eslint-plugin": "^5.8.1",
20
- "@typescript-eslint/parser": "^5.8.1",
21
- "esbuild": "^0.14.10",
22
- "esbuild-register": "^3.3.1",
23
- "eslint": "^8.6.0",
16
+ "@marko/compiler": "^5.19.1",
17
+ "@marko/fixture-snapshots": "^2.1.6",
18
+ "@marko/testing-library": "^6.0.0",
19
+ "@types/jsdom": "^16.2.14",
20
+ "@types/mocha": "^9.1.0",
21
+ "@types/node": "^17.0.15",
22
+ "@types/serve-handler": "^6.1.1",
23
+ "@typescript-eslint/eslint-plugin": "^5.10.2",
24
+ "@typescript-eslint/parser": "^5.10.2",
25
+ "esbuild": "^0.14.20",
26
+ "esbuild-register": "^3.3.2",
27
+ "eslint": "^8.8.0",
24
28
  "eslint-config-prettier": "^8.3.0",
25
- "fast-glob": "^3.2.7",
29
+ "fast-glob": "^3.2.11",
26
30
  "fixpack": "^4.0.0",
27
31
  "husky": "^7.0.4",
28
- "lint-staged": "^12.1.4",
29
- "marko": "^5.17.6",
30
- "mocha": "^9.1.3",
31
- "mocha-snap": "^4.2.1",
32
+ "jsdom": "^19.0.0",
33
+ "lint-staged": "^12.3.3",
34
+ "marko": "^5.19.0",
35
+ "mocha": "^9.2.0",
36
+ "mocha-snap": "^4.2.4",
32
37
  "nyc": "^15.1.0",
38
+ "playwright": "^1.18.1",
33
39
  "prettier": "^2.5.1",
34
- "semantic-release": "^18.0.1",
35
- "typescript": "^4.5.4",
36
- "vite": "^2.7.10"
40
+ "semantic-release": "^19.0.2",
41
+ "serve-handler": "^6.1.3",
42
+ "typescript": "^4.5.5",
43
+ "vite": "^2.7.13"
37
44
  },
38
45
  "exports": {
39
46
  ".": {