wxt 0.21.3 → 0.21.5
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/README.md +1 -1
- package/dist/{core/build.d.mts → build.d.mts} +2 -2
- package/dist/{core/build.mjs → build.mjs} +3 -4
- package/dist/{core/clean.d.mts → clean.d.mts} +2 -2
- package/dist/{core/clean.mjs → clean.mjs} +3 -3
- package/dist/cli/cli-utils.mjs +11 -8
- package/dist/cli/commands.mjs +10 -9
- package/dist/{core/create-server.d.mts → create-server.d.mts} +2 -2
- package/dist/{core/create-server.mjs → create-server.mjs} +13 -14
- package/dist/define-config.d.mts +6 -0
- package/dist/{core/define-config.mjs → define-config.mjs} +1 -1
- package/dist/{core/define-web-ext-config.d.mts → define-web-ext-config.d.mts} +2 -2
- package/dist/{core/define-web-ext-config.mjs → define-web-ext-config.mjs} +1 -1
- package/dist/index.d.mts +12 -12
- package/dist/index.mjs +10 -11
- package/dist/{core/initialize.d.mts → initialize.d.mts} +2 -1
- package/dist/{core/initialize.mjs → initialize.mjs} +22 -7
- package/dist/inline/dotenv-expand/index.mjs +31 -0
- package/dist/inline/get-port-please/index.mjs +196 -0
- package/dist/inline/is-wsl/index.mjs +44 -0
- package/dist/inline/normalize-path/index.mjs +23 -0
- package/dist/inline/ohash/index.mjs +113 -0
- package/dist/inline/scule/index.mjs +50 -0
- package/dist/{core/utils/building → internal}/build-entrypoints.mjs +5 -5
- package/dist/internal/builders/unknown.mjs +22 -0
- package/dist/{core → internal}/builders/vite/index.mjs +144 -139
- package/dist/internal/builders/vite/plugins/add-entrypoint-group-runtime-env-entries.mjs +16 -0
- package/dist/internal/builders/vite/plugins/add-runtime-env-entries.mjs +14 -0
- package/dist/{core/builders/vite/plugins/bundleAnalysis.mjs → internal/builders/vite/plugins/bundle-analysis.mjs} +1 -1
- package/dist/{core/builders/vite/plugins/cssEntrypoints.mjs → internal/builders/vite/plugins/css-entrypoints.mjs} +2 -2
- package/dist/{core/builders/vite/plugins/defineImportMeta.mjs → internal/builders/vite/plugins/define-import-meta.mjs} +1 -1
- package/dist/{core/builders/vite/plugins/devHtmlPrerender.mjs → internal/builders/vite/plugins/dev-html-prerender.mjs} +6 -7
- package/dist/{core/builders/vite/plugins/devServerGlobals.mjs → internal/builders/vite/plugins/dev-server-globals.mjs} +1 -1
- package/dist/{core/builders/vite/plugins/extensionApiMock.mjs → internal/builders/vite/plugins/extension-api-mock.mjs} +1 -1
- package/dist/{core/builders/vite/plugins/iifeAnonymous.mjs → internal/builders/vite/plugins/iife-anonymous.mjs} +1 -1
- package/dist/{core/builders/vite/plugins/iifeFooter.mjs → internal/builders/vite/plugins/iife-footer.mjs} +1 -1
- package/dist/internal/builders/vite/plugins/index.mjs +17 -0
- package/dist/{core/builders/vite/plugins/noopBackground.mjs → internal/builders/vite/plugins/noop-background.mjs} +2 -2
- package/dist/{core/builders/vite/plugins/removeEntrypointMainFunction.mjs → internal/builders/vite/plugins/remove-entrypoint-main-function.mjs} +3 -4
- package/dist/{core/builders/vite/plugins/resolveAppConfig.mjs → internal/builders/vite/plugins/resolve-app-config.mjs} +2 -2
- package/dist/{core/builders/vite/plugins/resolveVirtualModules.mjs → internal/builders/vite/plugins/resolve-virtual-modules.mjs} +8 -6
- package/dist/{core/builders/vite/plugins/tsconfigPaths.mjs → internal/builders/vite/plugins/tsconfig-paths.mjs} +1 -1
- package/dist/internal/builders/vite/plugins/wxt-plugin-loader.mjs +77 -0
- package/dist/{builtin-modules → internal/builtin-modules}/escape-unicode.mjs +2 -2
- package/dist/{builtin-modules → internal/builtin-modules}/favicon-permission.mjs +2 -2
- package/dist/{builtin-modules → internal/builtin-modules}/index.mjs +4 -2
- package/dist/internal/builtin-modules/plugins.mjs +21 -0
- package/dist/{builtin-modules → internal/builtin-modules}/unimport.mjs +20 -9
- package/dist/{core/utils → internal}/constants.mjs +1 -1
- package/dist/internal/detect-builder.mjs +9 -0
- package/dist/{core/utils/building → internal}/detect-dev-changes.mjs +4 -4
- package/dist/internal/detect-runner.mjs +11 -0
- package/dist/internal/entrypoint-finders/flat.mjs +84 -0
- package/dist/internal/environments/browser-environment.mjs +48 -0
- package/dist/{core/utils → internal}/environments/environment.mjs +1 -1
- package/dist/{core/utils → internal}/environments/extension-environment.mjs +1 -1
- package/dist/{core/utils/create-file-reloader.mjs → internal/file-reloader.mjs} +10 -11
- package/dist/{core/utils/building → internal}/find-entrypoints.mjs +10 -75
- package/dist/{core → internal}/generate-wxt-dir.mjs +10 -10
- package/dist/internal/get-public-files.mjs +14 -0
- package/dist/{core/utils/building → internal}/group-entrypoints.mjs +1 -1
- package/dist/{core/utils → internal}/i18n.mjs +1 -1
- package/dist/{core/utils/building → internal}/internal-build.mjs +10 -10
- package/dist/{core → internal}/keyboard-shortcuts.mjs +2 -1
- package/dist/{core/utils → internal}/manifest.mjs +14 -14
- package/dist/internal/package-managers/bun.mjs +22 -0
- package/dist/{core → internal}/package-managers/deno.mjs +1 -1
- package/dist/{core → internal}/package-managers/index.mjs +1 -1
- package/dist/{core → internal}/package-managers/npm.mjs +11 -5
- package/dist/{core → internal}/package-managers/pnpm.mjs +6 -3
- package/dist/{core → internal}/package-managers/yarn.mjs +6 -3
- package/dist/{core/utils → internal}/package.mjs +3 -3
- package/dist/{core/utils/building → internal}/rebuild.mjs +5 -5
- package/dist/{core → internal}/resolve-config.mjs +22 -42
- package/dist/internal/runners/manual.mjs +22 -0
- package/dist/internal/runners/web-ext.mjs +79 -0
- package/dist/{core/utils/globals.mjs → internal/runtime-env-entries.mjs} +4 -4
- package/dist/internal/spinner.mjs +69 -0
- package/dist/{core/utils → internal}/syntax-errors.mjs +2 -2
- package/dist/{core/utils → internal}/theme-icons.mjs +3 -3
- package/dist/{core/utils → internal}/transform.mjs +1 -1
- package/dist/{core/utils → internal}/validation.mjs +1 -1
- package/dist/{core → internal}/wxt.mjs +24 -7
- package/dist/{core/utils/arrays.mjs → internal-utils/array-utils.mjs} +1 -1
- package/dist/{core/utils/cache.mjs → internal-utils/cache-utils.mjs} +3 -3
- package/dist/{core/utils/content-scripts.mjs → internal-utils/content-script-utils.mjs} +2 -2
- package/dist/{core/utils/content-security-policy.mjs → internal-utils/csp-utils.mjs} +1 -1
- package/dist/{core/utils/entrypoints.d.mts → internal-utils/entrypoint-utils.d.mts} +2 -2
- package/dist/{core/utils/entrypoints.mjs → internal-utils/entrypoint-utils.mjs} +2 -2
- package/dist/{core/utils/env.mjs → internal-utils/env-utils.mjs} +3 -3
- package/dist/internal-utils/eslint-utils.mjs +8 -0
- package/dist/{core/utils/fs.mjs → internal-utils/fs-utils.mjs} +6 -11
- package/dist/internal-utils/log/index.mjs +6 -0
- package/dist/{core/utils/log/printBuildSummary.mjs → internal-utils/log/print-build-summary.mjs} +3 -3
- package/dist/{core/utils/log/printFileList.mjs → internal-utils/log/print-file-list.mjs} +9 -8
- package/dist/{core/utils/log/printHeader.mjs → internal-utils/log/print-header.mjs} +2 -2
- package/dist/{core/utils/log/printTable.mjs → internal-utils/log/print-table.mjs} +1 -1
- package/dist/internal-utils/log/wxt-logger.mjs +32 -0
- package/dist/internal-utils/module-utils.mjs +32 -0
- package/dist/{core/utils/number.mjs → internal-utils/number-utils.mjs} +1 -1
- package/dist/{core/utils/paths.d.mts → internal-utils/path-utils.d.mts} +1 -1
- package/dist/{core/utils/paths.mjs → internal-utils/path-utils.mjs} +3 -3
- package/dist/{core/utils/strings.mjs → internal-utils/string-utils.mjs} +3 -3
- package/dist/{core/utils/time.mjs → internal-utils/time-utils.mjs} +1 -1
- package/dist/{core/utils/types.d.mts → internal-utils/type-utils.d.mts} +2 -1
- package/dist/{modules.d.mts → modules/index.d.mts} +10 -4
- package/dist/{modules.mjs → modules/index.mjs} +14 -5
- package/dist/prepare.d.mts +6 -0
- package/dist/prepare.mjs +11 -0
- package/dist/testing/wxt-vitest-plugin.mjs +7 -7
- package/dist/types.d.mts +97 -47
- package/dist/utils/content-script-context.d.mts +1 -1
- package/dist/utils/content-script-ui/iframe.d.mts +7 -0
- package/dist/utils/content-script-ui/iframe.mjs +2 -0
- package/dist/utils/content-script-ui/integrated.d.mts +7 -0
- package/dist/utils/content-script-ui/integrated.mjs +2 -0
- package/dist/utils/content-script-ui/shadow-root.d.mts +7 -0
- package/dist/utils/content-script-ui/shadow-root.mjs +2 -0
- package/dist/utils/content-script-ui/types.d.mts +23 -7
- package/dist/utils/internal/custom-events.d.mts +11 -1
- package/dist/utils/internal/custom-events.mjs +4 -0
- package/dist/version.mjs +1 -1
- package/dist/virtual/background-entrypoint.mjs +11 -0
- package/dist/{core/zip.d.mts → zip.d.mts} +2 -2
- package/dist/{core/zip.mjs → zip.mjs} +11 -13
- package/package.json +14 -15
- package/dist/core/builders/vite/plugins/entrypointGroupGlobals.mjs +0 -16
- package/dist/core/builders/vite/plugins/globals.mjs +0 -14
- package/dist/core/builders/vite/plugins/index.mjs +0 -17
- package/dist/core/builders/vite/plugins/wxtPluginLoader.mjs +0 -56
- package/dist/core/define-config.d.mts +0 -6
- package/dist/core/index.d.mts +0 -10
- package/dist/core/index.mjs +0 -12
- package/dist/core/package-managers/bun.mjs +0 -19
- package/dist/core/prepare.d.mts +0 -6
- package/dist/core/prepare.mjs +0 -12
- package/dist/core/runners/manual.mjs +0 -11
- package/dist/core/runners/safari.mjs +0 -14
- package/dist/core/runners/web-ext.mjs +0 -63
- package/dist/core/runners/wsl.mjs +0 -14
- package/dist/core/utils/building/index.mjs +0 -7
- package/dist/core/utils/environments/browser-environment.mjs +0 -18
- package/dist/core/utils/eslint.mjs +0 -11
- package/dist/core/utils/index.d.mts +0 -2
- package/dist/core/utils/index.mjs +0 -3
- package/dist/core/utils/log/index.mjs +0 -5
- /package/dist/{core/utils → internal}/environments/index.mjs +0 -0
- /package/dist/{core/utils → internal}/virtual-modules.mjs +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
//#region inline/ohash/index.mjs
|
|
3
|
+
function t(e) {
|
|
4
|
+
return typeof e == `string` ? `'${e}'` : new n().serialize(e);
|
|
5
|
+
}
|
|
6
|
+
const n = function() {
|
|
7
|
+
class e {
|
|
8
|
+
#e = /* @__PURE__ */ new Map();
|
|
9
|
+
compare(e, t) {
|
|
10
|
+
let n = typeof e, r = typeof t;
|
|
11
|
+
return n === `string` && r === `string` ? e.localeCompare(t) : n === `number` && r === `number` ? e - t : String.prototype.localeCompare.call(this.serialize(e, !0), this.serialize(t, !0));
|
|
12
|
+
}
|
|
13
|
+
serialize(e, t) {
|
|
14
|
+
if (e === null) return `null`;
|
|
15
|
+
switch (typeof e) {
|
|
16
|
+
case `string`: return t ? e : `'${e}'`;
|
|
17
|
+
case `bigint`: return `${e}n`;
|
|
18
|
+
case `object`: return this.$object(e);
|
|
19
|
+
case `function`: return this.$function(e);
|
|
20
|
+
}
|
|
21
|
+
return String(e);
|
|
22
|
+
}
|
|
23
|
+
serializeObject(e) {
|
|
24
|
+
let t = Object.prototype.toString.call(e);
|
|
25
|
+
if (t !== `[object Object]`) return this.serializeBuiltInType(t.length < 10 ? `unknown:${t}` : t.slice(8, -1), e);
|
|
26
|
+
let n = e.constructor, r = n === Object || n === void 0 ? `` : n.name;
|
|
27
|
+
if (r !== `` && globalThis[r] === n) return this.serializeBuiltInType(r, e);
|
|
28
|
+
if (typeof e.toJSON == `function`) {
|
|
29
|
+
let t = e.toJSON();
|
|
30
|
+
return r + (typeof t == `object` && t ? this.$object(t) : `(${this.serialize(t)})`);
|
|
31
|
+
}
|
|
32
|
+
return this.serializeObjectEntries(r, Object.entries(e));
|
|
33
|
+
}
|
|
34
|
+
serializeBuiltInType(e, t) {
|
|
35
|
+
let n = this[`$` + e];
|
|
36
|
+
if (n) return n.call(this, t);
|
|
37
|
+
if (typeof t?.entries == `function`) return this.serializeObjectEntries(e, t.entries());
|
|
38
|
+
throw Error(`Cannot serialize ${e}`);
|
|
39
|
+
}
|
|
40
|
+
serializeObjectEntries(e, t) {
|
|
41
|
+
let n = Array.from(t).sort((e, t) => this.compare(e[0], t[0])), r = `${e}{`;
|
|
42
|
+
for (let e = 0; e < n.length; e++) {
|
|
43
|
+
let [t, i] = n[e];
|
|
44
|
+
r += `${this.serialize(t, !0)}:${this.serialize(i)}`, e < n.length - 1 && (r += `,`);
|
|
45
|
+
}
|
|
46
|
+
return r + `}`;
|
|
47
|
+
}
|
|
48
|
+
$object(e) {
|
|
49
|
+
let t = this.#e.get(e);
|
|
50
|
+
return t === void 0 && (this.#e.set(e, `#${this.#e.size}`), t = this.serializeObject(e), this.#e.set(e, t)), t;
|
|
51
|
+
}
|
|
52
|
+
$function(e) {
|
|
53
|
+
let t = Function.prototype.toString.call(e);
|
|
54
|
+
return t.slice(-15) === `[native code] }` ? `${e.name || ``}()[native]` : `${e.name}(${e.length})${t.replace(/\s*\n\s*/g, ``)}`;
|
|
55
|
+
}
|
|
56
|
+
$Array(e) {
|
|
57
|
+
let t = `[`;
|
|
58
|
+
for (let n = 0; n < e.length; n++) t += this.serialize(e[n]), n < e.length - 1 && (t += `,`);
|
|
59
|
+
return t + `]`;
|
|
60
|
+
}
|
|
61
|
+
$Date(e) {
|
|
62
|
+
try {
|
|
63
|
+
return `Date(${e.toISOString()})`;
|
|
64
|
+
} catch {
|
|
65
|
+
return `Date(null)`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
$ArrayBuffer(e) {
|
|
69
|
+
return `ArrayBuffer[${new Uint8Array(e).join(`,`)}]`;
|
|
70
|
+
}
|
|
71
|
+
$Set(e) {
|
|
72
|
+
return `Set${this.$Array(Array.from(e).sort((e, t) => this.compare(e, t)))}`;
|
|
73
|
+
}
|
|
74
|
+
$Map(e) {
|
|
75
|
+
return this.serializeObjectEntries(`Map`, e.entries());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
for (let t of [
|
|
79
|
+
`Error`,
|
|
80
|
+
`RegExp`,
|
|
81
|
+
`URL`
|
|
82
|
+
]) e.prototype[`$` + t] = function(e) {
|
|
83
|
+
return `${t}(${e})`;
|
|
84
|
+
};
|
|
85
|
+
for (let t of [
|
|
86
|
+
`Int8Array`,
|
|
87
|
+
`Uint8Array`,
|
|
88
|
+
`Uint8ClampedArray`,
|
|
89
|
+
`Int16Array`,
|
|
90
|
+
`Uint16Array`,
|
|
91
|
+
`Int32Array`,
|
|
92
|
+
`Uint32Array`,
|
|
93
|
+
`Float32Array`,
|
|
94
|
+
`Float64Array`
|
|
95
|
+
]) e.prototype[`$` + t] = function(e) {
|
|
96
|
+
return `${t}[${e.join(`,`)}]`;
|
|
97
|
+
};
|
|
98
|
+
for (let t of [`BigInt64Array`, `BigUint64Array`]) e.prototype[`$` + t] = function(e) {
|
|
99
|
+
return `${t}[${e.join(`n,`)}${e.length > 0 ? `n` : ``}]`;
|
|
100
|
+
};
|
|
101
|
+
return e;
|
|
102
|
+
}();
|
|
103
|
+
const i = globalThis.process?.getBuiltinModule?.(`crypto`)?.hash, a = `sha256`, o = `base64url`;
|
|
104
|
+
function s(t) {
|
|
105
|
+
if (i) return i(a, t, o);
|
|
106
|
+
let n = createHash(a).update(t);
|
|
107
|
+
return globalThis.process?.versions?.webcontainer ? n.digest().toString(o) : n.digest(o);
|
|
108
|
+
}
|
|
109
|
+
function c(e) {
|
|
110
|
+
return s(t(e));
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { c };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region inline/scule/index.mjs
|
|
2
|
+
const e = /\d/, t = [
|
|
3
|
+
`-`,
|
|
4
|
+
`_`,
|
|
5
|
+
`/`,
|
|
6
|
+
`.`
|
|
7
|
+
];
|
|
8
|
+
function n(t = ``) {
|
|
9
|
+
if (!e.test(t)) return t !== t.toLowerCase();
|
|
10
|
+
}
|
|
11
|
+
function r(e, r) {
|
|
12
|
+
let i = r ?? t, a = [];
|
|
13
|
+
if (!e || typeof e != `string`) return a;
|
|
14
|
+
let o = ``, s, c;
|
|
15
|
+
for (let t of e) {
|
|
16
|
+
let e = i.includes(t);
|
|
17
|
+
if (e === !0) {
|
|
18
|
+
a.push(o), o = ``, s = void 0;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
let r = n(t);
|
|
22
|
+
if (c === !1) {
|
|
23
|
+
if (s === !1 && r === !0) {
|
|
24
|
+
a.push(o), o = t, s = r;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (s === !0 && r === !1 && o.length > 1) {
|
|
28
|
+
let e = o.at(-1);
|
|
29
|
+
a.push(o.slice(0, Math.max(0, o.length - 1))), o = e + t, s = r;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
o += t, s = r, c = e;
|
|
34
|
+
}
|
|
35
|
+
return a.push(o), a;
|
|
36
|
+
}
|
|
37
|
+
function i(e) {
|
|
38
|
+
return e ? e[0].toUpperCase() + e.slice(1) : ``;
|
|
39
|
+
}
|
|
40
|
+
function a(e) {
|
|
41
|
+
return e ? e[0].toLowerCase() + e.slice(1) : ``;
|
|
42
|
+
}
|
|
43
|
+
function o(e, t) {
|
|
44
|
+
return e ? (Array.isArray(e) ? e : r(e)).map((e) => i(t?.normalize ? e.toLowerCase() : e)).join(``) : ``;
|
|
45
|
+
}
|
|
46
|
+
function s(e, t) {
|
|
47
|
+
return a(o(e || ``, t));
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { s };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { toArray } from "../
|
|
2
|
-
import { wxt } from "
|
|
3
|
-
import { getPublicFiles } from "
|
|
4
|
-
import { copyFile, mkdir, writeFile } from "node:fs/promises";
|
|
1
|
+
import { toArray } from "../internal-utils/array-utils.mjs";
|
|
2
|
+
import { wxt } from "./wxt.mjs";
|
|
3
|
+
import { getPublicFiles } from "./get-public-files.mjs";
|
|
5
4
|
import { dirname, resolve } from "path";
|
|
5
|
+
import { copyFile, mkdir, writeFile } from "node:fs/promises";
|
|
6
6
|
import { styleText } from "node:util";
|
|
7
|
-
//#region src/
|
|
7
|
+
//#region src/internal/build-entrypoints.ts
|
|
8
8
|
async function buildEntrypoints(groups, spinner) {
|
|
9
9
|
const steps = [];
|
|
10
10
|
for (let i = 0; i < groups.length; i++) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/internal/builders/unknown.ts
|
|
2
|
+
var UnknownBuilder = class {
|
|
3
|
+
name = "unknown";
|
|
4
|
+
version = "0.0.0";
|
|
5
|
+
build() {
|
|
6
|
+
this.missingBuilder();
|
|
7
|
+
}
|
|
8
|
+
importEntrypoint() {
|
|
9
|
+
this.missingBuilder();
|
|
10
|
+
}
|
|
11
|
+
importEntrypoints() {
|
|
12
|
+
this.missingBuilder();
|
|
13
|
+
}
|
|
14
|
+
createServer() {
|
|
15
|
+
this.missingBuilder();
|
|
16
|
+
}
|
|
17
|
+
missingBuilder() {
|
|
18
|
+
throw Error("No builder available. Install `vite`");
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { UnknownBuilder };
|
|
@@ -1,80 +1,150 @@
|
|
|
1
|
-
import { normalizePath } from "
|
|
2
|
-
import { getEntrypointBundlePath, isHtmlEntrypoint } from "
|
|
3
|
-
import "
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { resolveAppConfig } from "./plugins/resolveAppConfig.mjs";
|
|
21
|
-
import { iifeFooter } from "./plugins/iifeFooter.mjs";
|
|
22
|
-
import { iifeAnonymous } from "./plugins/iifeAnonymous.mjs";
|
|
1
|
+
import { normalizePath } from "../../../internal-utils/path-utils.mjs";
|
|
2
|
+
import { getEntrypointBundlePath, isHtmlEntrypoint } from "../../../internal-utils/entrypoint-utils.mjs";
|
|
3
|
+
import { toArray } from "../../../internal-utils/array-utils.mjs";
|
|
4
|
+
import { createExtensionEnvironment } from "../../environments/extension-environment.mjs";
|
|
5
|
+
import "../../environments/index.mjs";
|
|
6
|
+
import { safeVarName } from "../../../internal-utils/string-utils.mjs";
|
|
7
|
+
import { entrypointGroupGlobals } from "./plugins/add-entrypoint-group-runtime-env-entries.mjs";
|
|
8
|
+
import { addRuntimeEnvEntries } from "./plugins/add-runtime-env-entries.mjs";
|
|
9
|
+
import { bundleAnalysis } from "./plugins/bundle-analysis.mjs";
|
|
10
|
+
import { cssEntrypoints } from "./plugins/css-entrypoints.mjs";
|
|
11
|
+
import { defineImportMeta } from "./plugins/define-import-meta.mjs";
|
|
12
|
+
import { devHtmlPrerender } from "./plugins/dev-html-prerender.mjs";
|
|
13
|
+
import { devServerGlobals } from "./plugins/dev-server-globals.mjs";
|
|
14
|
+
import { iifeAnonymous } from "./plugins/iife-anonymous.mjs";
|
|
15
|
+
import { iifeFooter } from "./plugins/iife-footer.mjs";
|
|
16
|
+
import { noopBackground } from "./plugins/noop-background.mjs";
|
|
17
|
+
import { removeEntrypointMainFunction } from "./plugins/remove-entrypoint-main-function.mjs";
|
|
18
|
+
import { resolveAppConfig } from "./plugins/resolve-app-config.mjs";
|
|
19
|
+
import { tsconfigPaths } from "./plugins/tsconfig-paths.mjs";
|
|
23
20
|
import "./plugins/index.mjs";
|
|
24
21
|
import { mkdir, readdir, rename, rmdir, stat } from "node:fs/promises";
|
|
25
22
|
import { dirname, extname, join, relative, resolve } from "node:path";
|
|
26
|
-
//#region src/
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
//#region src/internal/builders/vite/index.ts
|
|
24
|
+
var ViteBuilder = class {
|
|
25
|
+
name = "Vite";
|
|
26
|
+
version;
|
|
27
|
+
constructor(vite, config, hooks, getWxtDevServer) {
|
|
28
|
+
this.vite = vite;
|
|
29
|
+
this.config = config;
|
|
30
|
+
this.hooks = hooks;
|
|
31
|
+
this.getWxtDevServer = getWxtDevServer;
|
|
32
|
+
this.version = vite.version;
|
|
33
|
+
}
|
|
34
|
+
async build(group) {
|
|
35
|
+
let entryConfig;
|
|
36
|
+
if (Array.isArray(group)) entryConfig = this.getMultiPageConfig(group);
|
|
37
|
+
else if (group.type === "content-script-style" || group.type === "unlisted-style") entryConfig = this.getCssConfig(group);
|
|
38
|
+
else entryConfig = this.getLibModeConfig(group);
|
|
39
|
+
const buildConfig = this.vite.mergeConfig(await this.getBaseConfig(), entryConfig);
|
|
40
|
+
await this.hooks.callHook("vite:build:extendConfig", toArray(group), buildConfig);
|
|
41
|
+
const chunks = getBuildOutputChunks(await this.vite.build(buildConfig));
|
|
42
|
+
return {
|
|
43
|
+
entrypoints: group,
|
|
44
|
+
chunks: await moveHtmlFiles(this.config, group, chunks)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async createServer(info) {
|
|
48
|
+
const serverConfig = { server: {
|
|
49
|
+
host: info.host,
|
|
50
|
+
port: info.port,
|
|
51
|
+
strictPort: true,
|
|
52
|
+
origin: info.origin
|
|
53
|
+
} };
|
|
54
|
+
const baseConfig = await this.getBaseConfig();
|
|
55
|
+
const finalConfig = this.vite.mergeConfig(baseConfig, serverConfig);
|
|
56
|
+
await this.hooks.callHook("vite:devServer:extendConfig", finalConfig);
|
|
57
|
+
const viteServer = await this.vite.createServer(finalConfig);
|
|
58
|
+
return {
|
|
59
|
+
async listen() {
|
|
60
|
+
await viteServer.listen(info.port);
|
|
61
|
+
},
|
|
62
|
+
async close() {
|
|
63
|
+
await viteServer.close();
|
|
64
|
+
},
|
|
65
|
+
transformHtml(...args) {
|
|
66
|
+
return viteServer.transformIndexHtml(...args);
|
|
67
|
+
},
|
|
68
|
+
ws: {
|
|
69
|
+
send(message, payload) {
|
|
70
|
+
return viteServer.ws.send(message, payload);
|
|
71
|
+
},
|
|
72
|
+
on(message, cb) {
|
|
73
|
+
viteServer.ws.on(message, cb);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
watcher: viteServer.watcher,
|
|
77
|
+
on(event, cb) {
|
|
78
|
+
viteServer.httpServer?.on(event, cb);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async importEntrypoint(path) {
|
|
83
|
+
const [module] = await this.importEntrypoints([path]);
|
|
84
|
+
return module;
|
|
85
|
+
}
|
|
86
|
+
async importEntrypoints(paths) {
|
|
87
|
+
const context = createExtensionEnvironment();
|
|
88
|
+
const environment = await this.createImporterEnvironment(paths);
|
|
89
|
+
try {
|
|
90
|
+
return await context.run(async () => await Promise.all(paths.map(async (path) => {
|
|
91
|
+
const module = await environment.runner.import(path);
|
|
92
|
+
this.requireDefaultExport(path, module);
|
|
93
|
+
return module.default;
|
|
94
|
+
})));
|
|
95
|
+
} finally {
|
|
96
|
+
await environment.close();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
29
99
|
/**
|
|
30
100
|
* Returns the base vite config shared by all builds based on the inline and
|
|
31
101
|
* user config.
|
|
32
102
|
*/
|
|
33
|
-
|
|
34
|
-
const config = await
|
|
35
|
-
config.root =
|
|
103
|
+
async getBaseConfig(options) {
|
|
104
|
+
const config = await this.config.vite(this.config.env);
|
|
105
|
+
config.root = this.config.root;
|
|
36
106
|
config.configFile = false;
|
|
37
107
|
config.logLevel = "warn";
|
|
38
|
-
config.mode =
|
|
108
|
+
config.mode = this.config.mode;
|
|
39
109
|
config.envPrefix ??= ["VITE_", "WXT_"];
|
|
40
110
|
config.build ??= {};
|
|
41
|
-
config.publicDir =
|
|
111
|
+
config.publicDir = this.config.publicDir;
|
|
42
112
|
config.build.copyPublicDir = false;
|
|
43
|
-
config.build.outDir =
|
|
113
|
+
config.build.outDir = this.config.outDir;
|
|
44
114
|
config.build.emptyOutDir = false;
|
|
45
|
-
if (config.build.minify == null &&
|
|
46
|
-
if (config.build.sourcemap == null &&
|
|
115
|
+
if (config.build.minify == null && this.config.command === "serve") config.build.minify = false;
|
|
116
|
+
if (config.build.sourcemap == null && this.config.command === "serve") config.build.sourcemap = "inline";
|
|
47
117
|
config.server ??= {};
|
|
48
118
|
config.server.watch = {
|
|
49
|
-
...
|
|
119
|
+
...this.config.watchOptions,
|
|
50
120
|
ignored: [
|
|
51
|
-
`${
|
|
52
|
-
`${
|
|
53
|
-
...getRunnerProfileWatchIgnores(
|
|
54
|
-
...toArray(
|
|
121
|
+
`${this.config.outBaseDir}/**`,
|
|
122
|
+
`${this.config.wxtDir}/**`,
|
|
123
|
+
...getRunnerProfileWatchIgnores(this.config),
|
|
124
|
+
...toArray(this.config.watchOptions.ignored ?? [])
|
|
55
125
|
]
|
|
56
126
|
};
|
|
57
127
|
config.legacy ??= {};
|
|
58
128
|
config.legacy.skipWebSocketTokenCheck = true;
|
|
59
|
-
if (isRolldownVersion(vite.version)) {} else {
|
|
129
|
+
if (isRolldownVersion(this.vite.version)) {} else {
|
|
60
130
|
config.esbuild ??= {};
|
|
61
131
|
if (config.esbuild) config.esbuild.charset = "ascii";
|
|
62
132
|
}
|
|
63
|
-
const server = getWxtDevServer?.();
|
|
133
|
+
const server = this.getWxtDevServer?.();
|
|
64
134
|
config.plugins ??= [];
|
|
65
|
-
config.plugins.push(devHtmlPrerender(
|
|
66
|
-
if (
|
|
135
|
+
config.plugins.push(devHtmlPrerender(this.config, server), devServerGlobals(this.config, server), tsconfigPaths(this.config), noopBackground(), addRuntimeEnvEntries(this.config), defineImportMeta(), resolveAppConfig(this.config));
|
|
136
|
+
if (this.config.analysis.enabled && !options?.excludeAnalysisPlugin) config.plugins.push(bundleAnalysis(this.config));
|
|
67
137
|
return config;
|
|
68
|
-
}
|
|
138
|
+
}
|
|
69
139
|
/**
|
|
70
140
|
* Return the basic config for building an entrypoint in [lib
|
|
71
141
|
* mode](https://vitejs.dev/guide/build.html#library-mode).
|
|
72
142
|
*/
|
|
73
|
-
|
|
143
|
+
getLibModeConfig(entrypoint) {
|
|
74
144
|
const entry = getRollupEntry(entrypoint);
|
|
75
145
|
const plugins = [entrypointGroupGlobals(entrypoint)];
|
|
76
146
|
let iifeReturnValueName = safeVarName(entrypoint.name);
|
|
77
|
-
if (entrypoint.type === "content-script-style" || entrypoint.type === "unlisted-style") plugins.push(cssEntrypoints(entrypoint,
|
|
147
|
+
if (entrypoint.type === "content-script-style" || entrypoint.type === "unlisted-style") plugins.push(cssEntrypoints(entrypoint, this.config));
|
|
78
148
|
if (entrypoint.type === "content-script" || entrypoint.type === "unlisted-script") {
|
|
79
149
|
if (typeof entrypoint.options.globalName === "string") iifeReturnValueName = entrypoint.options.globalName;
|
|
80
150
|
else if (typeof entrypoint.options.globalName === "function") iifeReturnValueName = entrypoint.options.globalName(entrypoint);
|
|
@@ -82,7 +152,7 @@ async function createViteBuilder(wxtConfig, hooks, getWxtDevServer) {
|
|
|
82
152
|
else plugins.push(iifeFooter(iifeReturnValueName));
|
|
83
153
|
}
|
|
84
154
|
return {
|
|
85
|
-
mode:
|
|
155
|
+
mode: this.config.mode,
|
|
86
156
|
plugins,
|
|
87
157
|
build: {
|
|
88
158
|
lib: {
|
|
@@ -92,24 +162,24 @@ async function createViteBuilder(wxtConfig, hooks, getWxtDevServer) {
|
|
|
92
162
|
fileName: entrypoint.name
|
|
93
163
|
},
|
|
94
164
|
rollupOptions: { output: {
|
|
95
|
-
entryFileNames: getEntrypointBundlePath(entrypoint,
|
|
165
|
+
entryFileNames: getEntrypointBundlePath(entrypoint, this.config.outDir, ".js"),
|
|
96
166
|
assetFileNames: (assetInfo) => {
|
|
97
167
|
if (entrypoint.type === "content-script" && getRollupAssetNames(assetInfo).some((name) => name.endsWith("css"))) return `content-scripts/${entrypoint.name}.[ext]`;
|
|
98
168
|
else return `assets/${entrypoint.name}.[ext]`;
|
|
99
169
|
}
|
|
100
170
|
} }
|
|
101
171
|
},
|
|
102
|
-
define: { "process.env.NODE_ENV": JSON.stringify(
|
|
172
|
+
define: { "process.env.NODE_ENV": JSON.stringify(this.config.mode) }
|
|
103
173
|
};
|
|
104
|
-
}
|
|
174
|
+
}
|
|
105
175
|
/**
|
|
106
176
|
* Return the basic config for building multiple entrypoints in [multi-page
|
|
107
177
|
* mode](https://vitejs.dev/guide/build.html#multi-page-app).
|
|
108
178
|
*/
|
|
109
|
-
|
|
179
|
+
getMultiPageConfig(entrypoints) {
|
|
110
180
|
const htmlEntrypoints = new Set(entrypoints.filter(isHtmlEntrypoint).map((e) => e.name));
|
|
111
181
|
return {
|
|
112
|
-
mode:
|
|
182
|
+
mode: this.config.mode,
|
|
113
183
|
plugins: [entrypointGroupGlobals(entrypoints)],
|
|
114
184
|
build: { rollupOptions: {
|
|
115
185
|
input: entrypoints.reduce((input, entry) => {
|
|
@@ -126,14 +196,10 @@ async function createViteBuilder(wxtConfig, hooks, getWxtDevServer) {
|
|
|
126
196
|
}
|
|
127
197
|
} }
|
|
128
198
|
};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
* Return the basic config for building a single CSS entrypoint in [multi-page
|
|
132
|
-
* mode](https://vitejs.dev/guide/build.html#multi-page-app).
|
|
133
|
-
*/
|
|
134
|
-
const getCssConfig = (entrypoint) => {
|
|
199
|
+
}
|
|
200
|
+
getCssConfig(entrypoint) {
|
|
135
201
|
return {
|
|
136
|
-
mode:
|
|
202
|
+
mode: this.config.mode,
|
|
137
203
|
plugins: [entrypointGroupGlobals(entrypoint)],
|
|
138
204
|
build: { rollupOptions: {
|
|
139
205
|
input: { [entrypoint.name]: entrypoint.inputPath },
|
|
@@ -143,15 +209,15 @@ async function createViteBuilder(wxtConfig, hooks, getWxtDevServer) {
|
|
|
143
209
|
} }
|
|
144
210
|
} }
|
|
145
211
|
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const baseConfig = await getBaseConfig({ excludeAnalysisPlugin: true });
|
|
212
|
+
}
|
|
213
|
+
async createImporterEnvironment(paths) {
|
|
214
|
+
const baseConfig = await this.getBaseConfig({ excludeAnalysisPlugin: true });
|
|
149
215
|
baseConfig.optimizeDeps ??= {};
|
|
150
216
|
baseConfig.optimizeDeps.noDiscovery = true;
|
|
151
217
|
baseConfig.optimizeDeps.include = [];
|
|
152
|
-
const envConfig = { plugins: paths.map((path) => removeEntrypointMainFunction(
|
|
153
|
-
const importerConfig = vite.mergeConfig(baseConfig, envConfig);
|
|
154
|
-
const config = await vite.resolveConfig(vite.mergeConfig(importerConfig || {}, {
|
|
218
|
+
const envConfig = { plugins: paths.map((path) => removeEntrypointMainFunction(this.config, path)) };
|
|
219
|
+
const importerConfig = this.vite.mergeConfig(baseConfig, envConfig);
|
|
220
|
+
const config = await this.vite.resolveConfig(this.vite.mergeConfig(importerConfig || {}, {
|
|
155
221
|
configFile: false,
|
|
156
222
|
envDir: false,
|
|
157
223
|
cacheDir: process.cwd(),
|
|
@@ -165,89 +231,21 @@ async function createViteBuilder(wxtConfig, hooks, getWxtDevServer) {
|
|
|
165
231
|
}
|
|
166
232
|
} }
|
|
167
233
|
}), "serve");
|
|
168
|
-
const environment = vite.createRunnableDevEnvironment("inline", config, {
|
|
234
|
+
const environment = this.vite.createRunnableDevEnvironment("inline", config, {
|
|
169
235
|
runnerOptions: { hmr: { logger: false } },
|
|
170
236
|
hot: false
|
|
171
237
|
});
|
|
172
238
|
await environment.init();
|
|
173
239
|
return environment;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const relativePath = relative(
|
|
240
|
+
}
|
|
241
|
+
requireDefaultExport(path, mod) {
|
|
242
|
+
const relativePath = relative(this.config.root, path);
|
|
177
243
|
if (mod?.default == null) {
|
|
178
244
|
const defineFn = relativePath.includes(".content") ? "defineContentScript" : relativePath.includes("background") ? "defineBackground" : "defineUnlistedScript";
|
|
179
245
|
throw Error(`${relativePath}: Default export not found, did you forget to call "export default ${defineFn}(...)"?`);
|
|
180
246
|
}
|
|
181
247
|
}
|
|
182
|
-
|
|
183
|
-
name: "Vite",
|
|
184
|
-
version: vite.version,
|
|
185
|
-
async importEntrypoint(path) {
|
|
186
|
-
const [module] = await this.importEntrypoints([path]);
|
|
187
|
-
return module;
|
|
188
|
-
},
|
|
189
|
-
async importEntrypoints(paths) {
|
|
190
|
-
const context = createExtensionEnvironment();
|
|
191
|
-
const environment = await createImporterEnvironment(paths);
|
|
192
|
-
try {
|
|
193
|
-
return await context.run(async () => await Promise.all(paths.map(async (path) => {
|
|
194
|
-
const module = await environment.runner.import(path);
|
|
195
|
-
requireDefaultExport(path, module);
|
|
196
|
-
return module.default;
|
|
197
|
-
})));
|
|
198
|
-
} finally {
|
|
199
|
-
await environment.close();
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
async build(group) {
|
|
203
|
-
let entryConfig;
|
|
204
|
-
if (Array.isArray(group)) entryConfig = getMultiPageConfig(group);
|
|
205
|
-
else if (group.type === "content-script-style" || group.type === "unlisted-style") entryConfig = getCssConfig(group);
|
|
206
|
-
else entryConfig = getLibModeConfig(group);
|
|
207
|
-
const buildConfig = vite.mergeConfig(await getBaseConfig(), entryConfig);
|
|
208
|
-
await hooks.callHook("vite:build:extendConfig", toArray(group), buildConfig);
|
|
209
|
-
return {
|
|
210
|
-
entrypoints: group,
|
|
211
|
-
chunks: await moveHtmlFiles(wxtConfig, group, getBuildOutputChunks(await vite.build(buildConfig)))
|
|
212
|
-
};
|
|
213
|
-
},
|
|
214
|
-
async createServer(info) {
|
|
215
|
-
const serverConfig = { server: {
|
|
216
|
-
host: info.host,
|
|
217
|
-
port: info.port,
|
|
218
|
-
strictPort: true,
|
|
219
|
-
origin: info.origin
|
|
220
|
-
} };
|
|
221
|
-
const baseConfig = await getBaseConfig();
|
|
222
|
-
const finalConfig = vite.mergeConfig(baseConfig, serverConfig);
|
|
223
|
-
await hooks.callHook("vite:devServer:extendConfig", finalConfig);
|
|
224
|
-
const viteServer = await vite.createServer(finalConfig);
|
|
225
|
-
return {
|
|
226
|
-
async listen() {
|
|
227
|
-
await viteServer.listen(info.port);
|
|
228
|
-
},
|
|
229
|
-
async close() {
|
|
230
|
-
await viteServer.close();
|
|
231
|
-
},
|
|
232
|
-
transformHtml(...args) {
|
|
233
|
-
return viteServer.transformIndexHtml(...args);
|
|
234
|
-
},
|
|
235
|
-
ws: {
|
|
236
|
-
send(message, payload) {
|
|
237
|
-
return viteServer.ws.send(message, payload);
|
|
238
|
-
},
|
|
239
|
-
on(message, cb) {
|
|
240
|
-
viteServer.ws.on(message, cb);
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
watcher: viteServer.watcher,
|
|
244
|
-
on(event, cb) {
|
|
245
|
-
viteServer.httpServer?.on(event, cb);
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
}
|
|
248
|
+
};
|
|
251
249
|
function getRunnerProfileWatchIgnores(wxtConfig) {
|
|
252
250
|
const root = normalizePath(wxtConfig.root);
|
|
253
251
|
const chromiumArgProfiles = extractPathArgs(wxtConfig.webExt.config?.chromiumArgs, "--user-data-dir");
|
|
@@ -347,7 +345,14 @@ async function removeEmptyDirs(dir) {
|
|
|
347
345
|
const files = await readdir(dir);
|
|
348
346
|
for (const file of files) {
|
|
349
347
|
const filePath = join(dir, file);
|
|
350
|
-
|
|
348
|
+
let stats;
|
|
349
|
+
try {
|
|
350
|
+
stats = await stat(filePath);
|
|
351
|
+
} catch (err) {
|
|
352
|
+
if (err?.code === "ENOENT") continue;
|
|
353
|
+
throw err;
|
|
354
|
+
}
|
|
355
|
+
if (stats.isDirectory()) await removeEmptyDirs(filePath);
|
|
351
356
|
}
|
|
352
357
|
try {
|
|
353
358
|
await rmdir(dir);
|
|
@@ -357,4 +362,4 @@ function isRolldownVersion(version) {
|
|
|
357
362
|
return Number(version.split(".")[0]) >= 8;
|
|
358
363
|
}
|
|
359
364
|
//#endregion
|
|
360
|
-
export {
|
|
365
|
+
export { ViteBuilder };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getEntrypointRuntimeEnvEntries } from "../../../runtime-env-entries.mjs";
|
|
2
|
+
//#region src/internal/builders/vite/plugins/add-entrypoint-group-runtime-env-entries.ts
|
|
3
|
+
/** Define a set of global variables specific to an entrypoint. */
|
|
4
|
+
function entrypointGroupGlobals(entrypointGroup) {
|
|
5
|
+
return {
|
|
6
|
+
name: "wxt:add-entrypoint-group-runtime-env-entries",
|
|
7
|
+
config() {
|
|
8
|
+
const define = {};
|
|
9
|
+
let name = Array.isArray(entrypointGroup) ? "html" : entrypointGroup.name;
|
|
10
|
+
for (const global of getEntrypointRuntimeEnvEntries(name)) define[`import.meta.env.${global.name}`] = JSON.stringify(global.value);
|
|
11
|
+
return { define };
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { entrypointGroupGlobals };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getRuntimeEnvEntries } from "../../../runtime-env-entries.mjs";
|
|
2
|
+
//#region src/internal/builders/vite/plugins/add-runtime-env-entries.ts
|
|
3
|
+
function addRuntimeEnvEntries(config) {
|
|
4
|
+
return {
|
|
5
|
+
name: "wxt:add-runtime-env-entries",
|
|
6
|
+
config() {
|
|
7
|
+
const define = {};
|
|
8
|
+
for (const global of getRuntimeEnvEntries(config)) define[`import.meta.env.${global.name}`] = JSON.stringify(global.value);
|
|
9
|
+
return { define };
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { addRuntimeEnvEntries };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { visualizer } from "@aklinker1/rollup-plugin-visualizer";
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/internal/builders/vite/plugins/bundle-analysis.ts
|
|
4
4
|
let increment = 0;
|
|
5
5
|
function bundleAnalysis(config) {
|
|
6
6
|
return visualizer({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getEntrypointBundlePath } from "
|
|
2
|
-
//#region src/
|
|
1
|
+
import { getEntrypointBundlePath } from "../../../../internal-utils/entrypoint-utils.mjs";
|
|
2
|
+
//#region src/internal/builders/vite/plugins/css-entrypoints.ts
|
|
3
3
|
/**
|
|
4
4
|
* Rename CSS entrypoint outputs to ensure a JS file is not generated, and that
|
|
5
5
|
* the CSS file is placed in the correct place.
|