@marko/vite 3.1.5 → 4.0.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.
Files changed (46) hide show
  1. package/README.md +0 -20
  2. package/dist/index.d.ts +3 -4
  3. package/dist/index.mjs +674 -103
  4. package/dist/manifest-generator.d.ts +1 -1
  5. package/dist/read-once-persisted-store.d.ts +6 -0
  6. package/dist/render-assets-runtime.d.ts +6 -0
  7. package/dist/serializer.d.ts +1 -1
  8. package/dist/server-entry-template.d.ts +1 -1
  9. package/package.json +20 -30
  10. package/dist/babel-plugin-cjs-interop.js +0 -117
  11. package/dist/babel-plugin-cjs-interop.mjs +0 -7
  12. package/dist/chunk-2E5QX7AF.mjs +0 -83
  13. package/dist/chunk-4NVOXZG5.mjs +0 -93
  14. package/dist/chunk-6IJ5UJ3N.mjs +0 -29
  15. package/dist/chunk-DCBMHGK4.mjs +0 -20
  16. package/dist/chunk-FCWFM7VD.mjs +0 -63
  17. package/dist/chunk-HR4PYNIR.mjs +0 -85
  18. package/dist/chunk-KIYHBIE6.mjs +0 -0
  19. package/dist/chunk-NTHVNXFC.mjs +0 -104
  20. package/dist/chunk-XYEU3RSG.mjs +0 -61
  21. package/dist/components/vite.marko +0 -74
  22. package/dist/esbuild-plugin.js +0 -113
  23. package/dist/esbuild-plugin.mjs +0 -6
  24. package/dist/index.js +0 -687
  25. package/dist/manifest-generator.js +0 -113
  26. package/dist/manifest-generator.mjs +0 -9
  27. package/dist/render-assets-transform.js +0 -41
  28. package/dist/render-assets-transform.mjs +0 -22
  29. package/dist/resolve.js +0 -94
  30. package/dist/resolve.mjs +0 -8
  31. package/dist/serializer.js +0 -127
  32. package/dist/serializer.mjs +0 -6
  33. package/dist/server-entry-template.js +0 -57
  34. package/dist/server-entry-template.mjs +0 -6
  35. package/dist/store/file-store.d.ts +0 -11
  36. package/dist/store/file-store.js +0 -91
  37. package/dist/store/file-store.mjs +0 -6
  38. package/dist/store/index.d.ts +0 -3
  39. package/dist/store/index.js +0 -41
  40. package/dist/store/index.mjs +0 -11
  41. package/dist/store/memory-store.d.ts +0 -8
  42. package/dist/store/memory-store.js +0 -38
  43. package/dist/store/memory-store.mjs +0 -6
  44. package/dist/store/types.d.ts +0 -5
  45. package/dist/store/types.js +0 -16
  46. package/dist/store/types.mjs +0 -0
@@ -1,7 +1,7 @@
1
1
  import serialize from "./serializer";
2
2
  type SerializedOrNull = null | ReturnType<typeof serialize>;
3
3
  export interface DocManifest {
4
- entries: string[];
4
+ preload: string[];
5
5
  "head-prepend": SerializedOrNull;
6
6
  head: SerializedOrNull;
7
7
  "body-prepend": SerializedOrNull;
@@ -0,0 +1,6 @@
1
+ export declare class ReadOncePersistedStore<T> {
2
+ private uid;
3
+ constructor(uid: string);
4
+ write(value: T): void;
5
+ read(): Promise<T>;
6
+ }
@@ -0,0 +1,6 @@
1
+ export declare const renderAssetsRuntimeId = "\0marko-render-assets.mjs";
2
+ export declare function getRenderAssetsRuntime(opts: {
3
+ isBuild: boolean;
4
+ runtimeId?: string;
5
+ basePathVar?: string;
6
+ }): string;
@@ -3,5 +3,5 @@ declare enum InjectType {
3
3
  AssetAttrs = 0,
4
4
  PublicPath = 1
5
5
  }
6
- export default function serialize(basePath: string, nodes: Node[], entries: string[], parts?: (string | InjectType)[]): (string | InjectType)[];
6
+ export default function serialize(basePath: string, nodes: Node[], preload: string[], parts?: (string | InjectType)[]): (string | InjectType)[];
7
7
  export {};
@@ -1,6 +1,6 @@
1
1
  declare const _default: (opts: {
2
2
  fileName: string;
3
- entryData: string;
3
+ entryData: string[];
4
4
  runtimeId?: string;
5
5
  basePathVar?: string;
6
6
  }) => Promise<string>;
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": "3.1.5",
4
+ "version": "4.0.0",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/vite/issues",
7
7
  "dependencies": {
@@ -15,44 +15,35 @@
15
15
  "devDependencies": {
16
16
  "@changesets/changelog-github": "^0.4.8",
17
17
  "@changesets/cli": "^2.26.2",
18
- "@marko/compiler": "^5.33.2",
18
+ "@marko/compiler": "^5.33.7",
19
19
  "@marko/fixture-snapshots": "^2.2.1",
20
20
  "@marko/testing-library": "^6.1.4",
21
- "@types/babel__core": "^7.20.3",
22
- "@types/jsdom": "^21.1.3",
23
- "@types/mocha": "^10.0.2",
24
- "@types/node": "^20.8.2",
25
- "@types/resolve": "^1.20.4",
26
- "@types/serve-handler": "^6.1.2",
27
- "@typescript-eslint/eslint-plugin": "^6.7.4",
28
- "@typescript-eslint/parser": "^6.7.4",
21
+ "@types/babel__core": "^7.20.4",
22
+ "@types/jsdom": "^21.1.5",
23
+ "@types/mocha": "^10.0.4",
24
+ "@types/node": "^20.9.0",
25
+ "@types/resolve": "^1.20.5",
26
+ "@types/serve-handler": "^6.1.4",
27
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
28
+ "@typescript-eslint/parser": "^6.10.0",
29
29
  "cross-env": "^7.0.3",
30
- "esbuild": "^0.19.4",
31
- "eslint": "^8.50.0",
30
+ "esbuild": "^0.19.5",
31
+ "eslint": "^8.53.0",
32
32
  "eslint-config-prettier": "^9.0.0",
33
- "fast-glob": "^3.3.1",
34
33
  "fixpack": "^4.0.0",
35
34
  "husky": "^8.0.3",
36
35
  "jsdom": "^22.1.0",
37
- "lint-staged": "^14.0.1",
38
- "marko": "^5.31.11",
36
+ "lint-staged": "^15.0.2",
37
+ "marko": "^5.31.17",
39
38
  "mocha": "^10.2.0",
40
39
  "mocha-snap": "^5.0.0",
41
40
  "nyc": "^15.1.0",
42
- "playwright": "^1.38.1",
43
- "prettier": "^2.8.8",
41
+ "playwright": "^1.39.0",
42
+ "prettier": "^3.0.3",
44
43
  "serve-handler": "^6.1.5",
45
- "tsx": "^3.14.0",
44
+ "tsx": "^4.1.0",
46
45
  "typescript": "^5.2.2",
47
- "vite": "^4.4.11"
48
- },
49
- "exports": {
50
- ".": {
51
- "import": "./dist/index.mjs",
52
- "default": "./dist/index.js"
53
- },
54
- "./dist/components/vite.marko": "./dist/components/vite.marko",
55
- "./dist/components/vite-watch.marko": "./dist/components/vite-watch.marko"
46
+ "vite": "^5.0.0-beta.17"
56
47
  },
57
48
  "files": [
58
49
  "dist",
@@ -68,11 +59,10 @@
68
59
  "vite"
69
60
  ],
70
61
  "license": "MIT",
71
- "main": "./dist/index.js",
72
- "module": "./dist/index.mjs",
62
+ "main": "./dist/index.mjs",
73
63
  "peerDependencies": {
74
64
  "@marko/compiler": "^5",
75
- "vite": "^2 || ^3 || ^4 || ^5"
65
+ "vite": "4 - 5"
76
66
  },
77
67
  "repository": {
78
68
  "type": "git",
@@ -1,117 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var babel_plugin_cjs_interop_exports = {};
30
- __export(babel_plugin_cjs_interop_exports, {
31
- default: () => plugin
32
- });
33
- module.exports = __toCommonJS(babel_plugin_cjs_interop_exports);
34
- var t = __toESM(require("@babel/types"));
35
- var import_resolve = require("./resolve");
36
- function plugin(options) {
37
- return {
38
- name: "marko-import-interop",
39
- visitor: {
40
- ImportDeclaration(path) {
41
- if (!path.node.specifiers.length || /\.(?:mjs|marko)$|\?/.test(path.node.source.value)) {
42
- return;
43
- }
44
- try {
45
- const resolved = (0, import_resolve.resolve)(
46
- path.node.source.value,
47
- path.hub.file.opts.filename,
48
- options.extensions,
49
- options.conditions
50
- );
51
- if (!/\.c?js$/.test(resolved) || !(0, import_resolve.isCJSModule)(resolved)) {
52
- return;
53
- }
54
- } catch (_) {
55
- return;
56
- }
57
- let namespaceId;
58
- let defaultImportId;
59
- let imports;
60
- for (const s of path.node.specifiers) {
61
- if (t.isImportSpecifier(s)) {
62
- (imports || (imports = [])).push({
63
- name: t.isStringLiteral(s.imported) ? s.imported.value : s.imported.name,
64
- alias: s.local.name
65
- });
66
- } else if (t.isImportDefaultSpecifier(s)) {
67
- defaultImportId = s.local;
68
- } else if (t.isImportNamespaceSpecifier(s)) {
69
- namespaceId = s.local;
70
- }
71
- }
72
- namespaceId || (namespaceId = path.scope.generateUidIdentifier(
73
- (defaultImportId == null ? void 0 : defaultImportId.name) || path.node.source.value
74
- ));
75
- path.node.specifiers = [t.importDefaultSpecifier(namespaceId)];
76
- if (defaultImportId) {
77
- path.insertAfter(
78
- t.variableDeclaration("const", [
79
- t.variableDeclarator(
80
- defaultImportId,
81
- t.conditionalExpression(
82
- t.optionalMemberExpression(
83
- namespaceId,
84
- t.identifier("__esModule"),
85
- false,
86
- true
87
- ),
88
- t.memberExpression(namespaceId, t.identifier("default")),
89
- namespaceId
90
- )
91
- )
92
- ])
93
- );
94
- }
95
- if (imports) {
96
- path.insertAfter(
97
- t.variableDeclaration("const", [
98
- t.variableDeclarator(
99
- t.objectPattern(
100
- imports.map(
101
- ({ name, alias }) => t.objectProperty(
102
- t.identifier(name),
103
- t.identifier(alias),
104
- false,
105
- name === alias
106
- )
107
- )
108
- ),
109
- namespaceId
110
- )
111
- ])
112
- );
113
- }
114
- }
115
- }
116
- };
117
- }
@@ -1,7 +0,0 @@
1
- import {
2
- plugin
3
- } from "./chunk-4NVOXZG5.mjs";
4
- import "./chunk-XYEU3RSG.mjs";
5
- export {
6
- plugin as default
7
- };
@@ -1,83 +0,0 @@
1
- import {
2
- serialize
3
- } from "./chunk-NTHVNXFC.mjs";
4
-
5
- // src/manifest-generator.ts
6
- import { Parser } from "htmlparser2";
7
- import { ElementType } from "domelementtype";
8
- import { DomHandler } from "domhandler";
9
- var MARKER_COMMENT = "MARKO_VITE";
10
- function generateDocManifest(basePath, rawHtml) {
11
- return new Promise((resolve, reject) => {
12
- const parser = new Parser(
13
- new DomHandler(function(err, dom) {
14
- if (err) {
15
- return reject(err);
16
- }
17
- const htmlChildren = dom.find(isElement).childNodes;
18
- const entries = [];
19
- const headPrepend = [];
20
- const head = [];
21
- const bodyPrepend = [];
22
- const body = [];
23
- splitNodesByMarker(
24
- htmlChildren.find(
25
- (node) => isElement(node) && node.tagName === "head"
26
- ).childNodes,
27
- headPrepend,
28
- head
29
- );
30
- splitNodesByMarker(
31
- htmlChildren.find(
32
- (node) => isElement(node) && node.tagName === "body"
33
- ).childNodes,
34
- bodyPrepend,
35
- body
36
- );
37
- resolve({
38
- entries,
39
- "head-prepend": serializeOrNull(basePath, headPrepend, entries),
40
- head: serializeOrNull(basePath, head, entries),
41
- "body-prepend": serializeOrNull(basePath, bodyPrepend, entries),
42
- body: serializeOrNull(basePath, body, entries)
43
- });
44
- })
45
- );
46
- parser.write(rawHtml);
47
- parser.end();
48
- });
49
- }
50
- function generateInputDoc(entry) {
51
- return `<!DOCTYPE html><html><head><!--${MARKER_COMMENT}--></head><body><!--${MARKER_COMMENT}--><script async type="module" src=${JSON.stringify(
52
- entry
53
- )}></script></body></html>`;
54
- }
55
- function serializeOrNull(basePath, nodes, entries) {
56
- const result = serialize(basePath, nodes, entries);
57
- if (result.length) {
58
- return result;
59
- }
60
- return null;
61
- }
62
- function splitNodesByMarker(nodes, before, after) {
63
- for (let i = 0; i < nodes.length; i++) {
64
- let node = nodes[i];
65
- if (node.data === MARKER_COMMENT) {
66
- i++;
67
- for (; i < nodes.length; i++) {
68
- node = nodes[i];
69
- after.push(node);
70
- }
71
- break;
72
- }
73
- before.push(node);
74
- }
75
- }
76
- function isElement(node) {
77
- return node.type === ElementType.Tag;
78
- }
79
-
80
- export {
81
- generateDocManifest,
82
- generateInputDoc
83
- };
@@ -1,93 +0,0 @@
1
- import {
2
- isCJSModule,
3
- resolve
4
- } from "./chunk-XYEU3RSG.mjs";
5
-
6
- // src/babel-plugin-cjs-interop.ts
7
- import * as t from "@babel/types";
8
- function plugin(options) {
9
- return {
10
- name: "marko-import-interop",
11
- visitor: {
12
- ImportDeclaration(path) {
13
- if (!path.node.specifiers.length || /\.(?:mjs|marko)$|\?/.test(path.node.source.value)) {
14
- return;
15
- }
16
- try {
17
- const resolved = resolve(
18
- path.node.source.value,
19
- path.hub.file.opts.filename,
20
- options.extensions,
21
- options.conditions
22
- );
23
- if (!/\.c?js$/.test(resolved) || !isCJSModule(resolved)) {
24
- return;
25
- }
26
- } catch (_) {
27
- return;
28
- }
29
- let namespaceId;
30
- let defaultImportId;
31
- let imports;
32
- for (const s of path.node.specifiers) {
33
- if (t.isImportSpecifier(s)) {
34
- (imports || (imports = [])).push({
35
- name: t.isStringLiteral(s.imported) ? s.imported.value : s.imported.name,
36
- alias: s.local.name
37
- });
38
- } else if (t.isImportDefaultSpecifier(s)) {
39
- defaultImportId = s.local;
40
- } else if (t.isImportNamespaceSpecifier(s)) {
41
- namespaceId = s.local;
42
- }
43
- }
44
- namespaceId || (namespaceId = path.scope.generateUidIdentifier(
45
- (defaultImportId == null ? void 0 : defaultImportId.name) || path.node.source.value
46
- ));
47
- path.node.specifiers = [t.importDefaultSpecifier(namespaceId)];
48
- if (defaultImportId) {
49
- path.insertAfter(
50
- t.variableDeclaration("const", [
51
- t.variableDeclarator(
52
- defaultImportId,
53
- t.conditionalExpression(
54
- t.optionalMemberExpression(
55
- namespaceId,
56
- t.identifier("__esModule"),
57
- false,
58
- true
59
- ),
60
- t.memberExpression(namespaceId, t.identifier("default")),
61
- namespaceId
62
- )
63
- )
64
- ])
65
- );
66
- }
67
- if (imports) {
68
- path.insertAfter(
69
- t.variableDeclaration("const", [
70
- t.variableDeclarator(
71
- t.objectPattern(
72
- imports.map(
73
- ({ name, alias }) => t.objectProperty(
74
- t.identifier(name),
75
- t.identifier(alias),
76
- false,
77
- name === alias
78
- )
79
- )
80
- ),
81
- namespaceId
82
- )
83
- ])
84
- );
85
- }
86
- }
87
- }
88
- };
89
- }
90
-
91
- export {
92
- plugin
93
- };
@@ -1,29 +0,0 @@
1
- // src/server-entry-template.ts
2
- import path from "path";
3
- var server_entry_template_default = async (opts) => {
4
- const fileNameStr = JSON.stringify(`./${path.basename(opts.fileName)}`);
5
- const base = opts.basePathVar ? ` base=${opts.basePathVar}` : "";
6
- return `import template from ${fileNameStr};
7
- export * from ${fileNameStr};
8
- ${opts.basePathVar ? `
9
- static if (typeof ${opts.basePathVar} !== "string") throw new Error("${opts.basePathVar} must be defined when using basePathVar.");
10
- static if (!${opts.basePathVar}.endsWith("/")) throw new Error("${opts.basePathVar} must end with a '/' when using basePathVar.");
11
- ` : ""}${opts.runtimeId ? `$ out.global.runtimeId = ${JSON.stringify(opts.runtimeId)};
12
- $ out.global.___viteBaseVar = ${JSON.stringify(
13
- "$mbp_" + opts.runtimeId
14
- )};
15
- ` : `$ out.global.___viteBaseVar = "$mbp";
16
- `}$ (out.global.___viteEntries || (out.global.___viteEntries = [])).push(${opts.entryData});
17
- <_vite${base} slot="head-prepend"/>
18
- <_vite${base} slot="head"/>
19
- <_vite${base} slot="body-prepend"/>
20
- <\${template} ...input/>
21
- <init-components/>
22
- <await-reorderer/>
23
- <_vite${base} slot="body"/>
24
- `;
25
- };
26
-
27
- export {
28
- server_entry_template_default
29
- };
@@ -1,20 +0,0 @@
1
- // src/store/memory-store.ts
2
- var MemoryStore = class {
3
- _store;
4
- constructor() {
5
- this._store = /* @__PURE__ */ new Map();
6
- }
7
- async has(key) {
8
- return Promise.resolve(this._store.has(key));
9
- }
10
- async get(key) {
11
- return Promise.resolve(this._store.get(key));
12
- }
13
- async set(key, value) {
14
- this._store.set(key, value);
15
- }
16
- };
17
-
18
- export {
19
- MemoryStore
20
- };
@@ -1,63 +0,0 @@
1
- // src/store/file-store.ts
2
- import path from "path";
3
- import fs from "fs";
4
- import os from "os";
5
- var FileStore = class {
6
- _id;
7
- _temp;
8
- _cache;
9
- constructor(id) {
10
- this._id = id;
11
- this._cache = /* @__PURE__ */ new Map();
12
- }
13
- async _getKeyPath(key) {
14
- this._temp ?? (this._temp = getTempDir(this._id));
15
- return path.join(await this._temp, key);
16
- }
17
- async has(key) {
18
- if (!this._cache.has(key)) {
19
- const path2 = await this._getKeyPath(key);
20
- try {
21
- await fs.promises.access(path2);
22
- } catch (e) {
23
- return false;
24
- }
25
- }
26
- return true;
27
- }
28
- async get(key) {
29
- let value = this._cache.get(key);
30
- if (value === void 0) {
31
- const path2 = await this._getKeyPath(key);
32
- try {
33
- value = await fs.promises.readFile(path2, "utf-8");
34
- } catch (e) {
35
- return void 0;
36
- }
37
- this._cache.set(key, value);
38
- }
39
- return value;
40
- }
41
- async set(key, value) {
42
- this._cache.set(key, value);
43
- const path2 = await this._getKeyPath(key);
44
- await fs.promises.writeFile(path2, value, "utf-8");
45
- }
46
- };
47
- async function getTempDir(id) {
48
- const dir = path.join(os.tmpdir(), id);
49
- try {
50
- const stat = await fs.promises.stat(dir);
51
- if (stat.isDirectory()) {
52
- return dir;
53
- }
54
- } catch {
55
- await fs.promises.mkdir(dir);
56
- return dir;
57
- }
58
- throw new Error("Unable to create temp directory");
59
- }
60
-
61
- export {
62
- FileStore
63
- };
@@ -1,85 +0,0 @@
1
- // src/esbuild-plugin.ts
2
- import fs from "fs";
3
- import path from "path";
4
- var markoErrorRegExp = /^(.+?)(?:\((\d+)(?:\s*,\s*(\d+))?\))?: (.*)$/gm;
5
- function esbuildPlugin(compiler, config) {
6
- return {
7
- name: "marko",
8
- async setup(build) {
9
- var _a;
10
- const { platform = "browser" } = build.initialOptions;
11
- const isScan = (_a = build.initialOptions.plugins) == null ? void 0 : _a.some(
12
- (v) => v.name === "vite:dep-scan"
13
- );
14
- const virtualFiles = /* @__PURE__ */ new Map();
15
- const finalConfig = {
16
- ...config,
17
- output: isScan ? "hydrate" : platform === "browser" ? "dom" : "html",
18
- resolveVirtualDependency(from, dep) {
19
- virtualFiles.set(path.join(from, "..", dep.virtualPath), dep);
20
- return dep.virtualPath;
21
- }
22
- };
23
- build.onResolve({ filter: /\.marko\./ }, (args) => {
24
- return {
25
- namespace: "marko:virtual",
26
- path: path.resolve(args.resolveDir, args.path)
27
- };
28
- });
29
- build.onLoad(
30
- { filter: /\.marko\./, namespace: "marko:virtual" },
31
- (args) => ({
32
- contents: virtualFiles.get(args.path).code,
33
- loader: path.extname(args.path).slice(1),
34
- external: isScan
35
- })
36
- );
37
- build.onLoad({ filter: /\.marko$/ }, async (args) => {
38
- try {
39
- const { code, meta } = await compiler.compileFile(
40
- args.path,
41
- finalConfig
42
- );
43
- return {
44
- loader: "js",
45
- contents: code,
46
- watchFiles: meta.watchFiles,
47
- resolveDir: path.dirname(args.path)
48
- };
49
- } catch (e) {
50
- const text = e.message;
51
- const errors = [];
52
- let match;
53
- let lines;
54
- while (match = markoErrorRegExp.exec(text)) {
55
- const [, file, rawLine, rawCol, text2] = match;
56
- const line = parseInt(rawLine, 10) || 1;
57
- const column = parseInt(rawCol, 10) || 1;
58
- lines || (lines = (await fs.promises.readFile(args.path, "utf-8")).split(
59
- /\n/g
60
- ));
61
- errors.push({
62
- text: text2,
63
- location: {
64
- file,
65
- line,
66
- column,
67
- lineText: ` ${lines[line - 1]}`
68
- }
69
- });
70
- }
71
- if (!errors.length) {
72
- errors.push({ text });
73
- }
74
- return {
75
- errors
76
- };
77
- }
78
- });
79
- }
80
- };
81
- }
82
-
83
- export {
84
- esbuildPlugin
85
- };
File without changes