@marko/vite 3.0.0 → 3.0.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.js +9 -2
- package/dist/index.mjs +9 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112,7 +112,7 @@ function markoPlugin(opts = {}) {
|
|
|
112
112
|
enforce: "pre",
|
|
113
113
|
// Must be pre to allow us to resolve assets before vite.
|
|
114
114
|
async config(config, env) {
|
|
115
|
-
var _a, _b;
|
|
115
|
+
var _a, _b, _c, _d, _e;
|
|
116
116
|
compiler ?? (compiler = await import(opts.compiler || "@marko/compiler"));
|
|
117
117
|
runtimeId = opts.runtimeId;
|
|
118
118
|
basePathVar = opts.basePathVar;
|
|
@@ -165,6 +165,13 @@ function markoPlugin(opts = {}) {
|
|
|
165
165
|
);
|
|
166
166
|
if (isTest) {
|
|
167
167
|
linked = false;
|
|
168
|
+
if ((_b = (_a = config.test) == null ? void 0 : _a.environment) == null ? void 0 : _b.includes(
|
|
169
|
+
"dom"
|
|
170
|
+
)) {
|
|
171
|
+
config.resolve ?? (config.resolve = {});
|
|
172
|
+
(_c = config.resolve).conditions ?? (_c.conditions = []);
|
|
173
|
+
config.resolve.conditions.push("browser");
|
|
174
|
+
}
|
|
168
175
|
}
|
|
169
176
|
if (linked && !registeredTag) {
|
|
170
177
|
const transformer = import_path.default.resolve(
|
|
@@ -231,7 +238,7 @@ function markoPlugin(opts = {}) {
|
|
|
231
238
|
"Cannot use @marko/vite `basePathVar` with Vite's `renderBuiltUrl` option."
|
|
232
239
|
);
|
|
233
240
|
}
|
|
234
|
-
const assetsDir = ((
|
|
241
|
+
const assetsDir = ((_e = (_d = config.build) == null ? void 0 : _d.assetsDir) == null ? void 0 : _e.replace(/[/\\]$/, "")) ?? "assets";
|
|
235
242
|
const assetsDirLen = assetsDir.length;
|
|
236
243
|
const assetsDirEnd = assetsDirLen + 1;
|
|
237
244
|
const trimAssertsDir = (fileName) => {
|
package/dist/index.mjs
CHANGED
|
@@ -92,7 +92,7 @@ function markoPlugin(opts = {}) {
|
|
|
92
92
|
enforce: "pre",
|
|
93
93
|
// Must be pre to allow us to resolve assets before vite.
|
|
94
94
|
async config(config, env) {
|
|
95
|
-
var _a, _b;
|
|
95
|
+
var _a, _b, _c, _d, _e;
|
|
96
96
|
compiler ?? (compiler = await import(opts.compiler || "@marko/compiler"));
|
|
97
97
|
runtimeId = opts.runtimeId;
|
|
98
98
|
basePathVar = opts.basePathVar;
|
|
@@ -145,6 +145,13 @@ function markoPlugin(opts = {}) {
|
|
|
145
145
|
);
|
|
146
146
|
if (isTest) {
|
|
147
147
|
linked = false;
|
|
148
|
+
if ((_b = (_a = config.test) == null ? void 0 : _a.environment) == null ? void 0 : _b.includes(
|
|
149
|
+
"dom"
|
|
150
|
+
)) {
|
|
151
|
+
config.resolve ?? (config.resolve = {});
|
|
152
|
+
(_c = config.resolve).conditions ?? (_c.conditions = []);
|
|
153
|
+
config.resolve.conditions.push("browser");
|
|
154
|
+
}
|
|
148
155
|
}
|
|
149
156
|
if (linked && !registeredTag) {
|
|
150
157
|
const transformer = path.resolve(
|
|
@@ -211,7 +218,7 @@ function markoPlugin(opts = {}) {
|
|
|
211
218
|
"Cannot use @marko/vite `basePathVar` with Vite's `renderBuiltUrl` option."
|
|
212
219
|
);
|
|
213
220
|
}
|
|
214
|
-
const assetsDir = ((
|
|
221
|
+
const assetsDir = ((_e = (_d = config.build) == null ? void 0 : _d.assetsDir) == null ? void 0 : _e.replace(/[/\\]$/, "")) ?? "assets";
|
|
215
222
|
const assetsDirLen = assetsDir.length;
|
|
216
223
|
const assetsDirEnd = assetsDirLen + 1;
|
|
217
224
|
const trimAssertsDir = (fileName) => {
|