@marko/vite 2.3.8 → 2.3.9
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 +5 -14
- package/dist/index.mjs +5 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -110,7 +110,6 @@ function markoPlugin(opts = {}) {
|
|
|
110
110
|
name: "marko-vite:pre",
|
|
111
111
|
enforce: "pre",
|
|
112
112
|
async config(config, env) {
|
|
113
|
-
var _a2, _b, _c;
|
|
114
113
|
compiler ?? (compiler = await import(opts.compiler || "@marko/compiler"));
|
|
115
114
|
root = normalizePath(config.root || process.cwd());
|
|
116
115
|
devEntryFile = import_path.default.join(root, "index.html");
|
|
@@ -146,23 +145,15 @@ function markoPlugin(opts = {}) {
|
|
|
146
145
|
...compiler.getRuntimeEntryFiles("html", opts.translator),
|
|
147
146
|
...taglibDeps
|
|
148
147
|
]));
|
|
148
|
+
const optimizeExtensions = optimizeDeps.extensions ?? (optimizeDeps.extensions = []);
|
|
149
|
+
optimizeExtensions.push(".marko");
|
|
150
|
+
const esbuildOptions = optimizeDeps.esbuildOptions ?? (optimizeDeps.esbuildOptions = {});
|
|
151
|
+
const esbuildPlugins = esbuildOptions.plugins ?? (esbuildOptions.plugins = []);
|
|
152
|
+
esbuildPlugins.push((0, import_esbuild_plugin.default)(compiler, baseConfig));
|
|
149
153
|
const ssr = config.ssr ?? (config.ssr = {});
|
|
150
154
|
if (ssr.noExternal !== true) {
|
|
151
155
|
ssr.noExternal = Array.from(new Set(taglibDeps.concat(ssr.noExternal || [])));
|
|
152
156
|
}
|
|
153
|
-
return {
|
|
154
|
-
...config,
|
|
155
|
-
optimizeDeps: {
|
|
156
|
-
...config.optimizeDeps,
|
|
157
|
-
extensions: [".marko", ...((_a2 = config.optimizeDeps) == null ? void 0 : _a2.extensions) || []],
|
|
158
|
-
esbuildOptions: {
|
|
159
|
-
plugins: [
|
|
160
|
-
(0, import_esbuild_plugin.default)(compiler, baseConfig),
|
|
161
|
-
...((_c = (_b = config.optimizeDeps) == null ? void 0 : _b.esbuildOptions) == null ? void 0 : _c.plugins) || []
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
157
|
},
|
|
167
158
|
configureServer(_server) {
|
|
168
159
|
ssrConfig.hot = domConfig.hot = true;
|
package/dist/index.mjs
CHANGED
|
@@ -93,7 +93,6 @@ function markoPlugin(opts = {}) {
|
|
|
93
93
|
name: "marko-vite:pre",
|
|
94
94
|
enforce: "pre",
|
|
95
95
|
async config(config, env) {
|
|
96
|
-
var _a2, _b, _c;
|
|
97
96
|
compiler ?? (compiler = await import(opts.compiler || "@marko/compiler"));
|
|
98
97
|
root = normalizePath(config.root || process.cwd());
|
|
99
98
|
devEntryFile = path.join(root, "index.html");
|
|
@@ -129,23 +128,15 @@ function markoPlugin(opts = {}) {
|
|
|
129
128
|
...compiler.getRuntimeEntryFiles("html", opts.translator),
|
|
130
129
|
...taglibDeps
|
|
131
130
|
]));
|
|
131
|
+
const optimizeExtensions = optimizeDeps.extensions ?? (optimizeDeps.extensions = []);
|
|
132
|
+
optimizeExtensions.push(".marko");
|
|
133
|
+
const esbuildOptions = optimizeDeps.esbuildOptions ?? (optimizeDeps.esbuildOptions = {});
|
|
134
|
+
const esbuildPlugins = esbuildOptions.plugins ?? (esbuildOptions.plugins = []);
|
|
135
|
+
esbuildPlugins.push(esbuildPlugin(compiler, baseConfig));
|
|
132
136
|
const ssr = config.ssr ?? (config.ssr = {});
|
|
133
137
|
if (ssr.noExternal !== true) {
|
|
134
138
|
ssr.noExternal = Array.from(new Set(taglibDeps.concat(ssr.noExternal || [])));
|
|
135
139
|
}
|
|
136
|
-
return {
|
|
137
|
-
...config,
|
|
138
|
-
optimizeDeps: {
|
|
139
|
-
...config.optimizeDeps,
|
|
140
|
-
extensions: [".marko", ...((_a2 = config.optimizeDeps) == null ? void 0 : _a2.extensions) || []],
|
|
141
|
-
esbuildOptions: {
|
|
142
|
-
plugins: [
|
|
143
|
-
esbuildPlugin(compiler, baseConfig),
|
|
144
|
-
...((_c = (_b = config.optimizeDeps) == null ? void 0 : _b.esbuildOptions) == null ? void 0 : _c.plugins) || []
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
140
|
},
|
|
150
141
|
configureServer(_server) {
|
|
151
142
|
ssrConfig.hot = domConfig.hot = true;
|