@marko/vite 2.2.8 → 2.2.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 +19 -21
- package/dist/index.mjs +19 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -134,30 +134,28 @@ function markoPlugin(opts = {}) {
|
|
|
134
134
|
"<body>": { transformer }
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const entry = tag.template || tag.renderer;
|
|
148
|
-
if (entry) {
|
|
149
|
-
taglibDeps.push(entry.replace(/^.*?[\\/]node_modules[\\/]/, ""));
|
|
150
|
-
}
|
|
137
|
+
const lookup = compiler.taglib.buildLookup(root);
|
|
138
|
+
const taglibDeps = [];
|
|
139
|
+
for (const name in lookup.taglibsById) {
|
|
140
|
+
const taglib = lookup.taglibsById[name];
|
|
141
|
+
if (/[\\/]node_modules[\\/](?!@marko[\\/])/.test(taglib.dirname)) {
|
|
142
|
+
for (const tagName in taglib.tags) {
|
|
143
|
+
const tag = taglib.tags[tagName];
|
|
144
|
+
const entry = tag.template || tag.renderer;
|
|
145
|
+
if (entry) {
|
|
146
|
+
taglibDeps.push(entry.replace(/^.*?[\\/]node_modules[\\/]/, ""));
|
|
151
147
|
}
|
|
152
148
|
}
|
|
153
149
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
150
|
+
}
|
|
151
|
+
const domDeps = Array.from(new Set(compiler.getRuntimeEntryFiles("dom", opts.translator).concat(taglibDeps)));
|
|
152
|
+
const optimizeDeps = config.optimizeDeps ?? (config.optimizeDeps = {});
|
|
153
|
+
optimizeDeps.include ?? (optimizeDeps.include = []);
|
|
154
|
+
optimizeDeps.include = optimizeDeps.include.concat(domDeps.filter((dep) => import_path.default.extname(dep) !== markoExt));
|
|
155
|
+
optimizeDeps.exclude ?? (optimizeDeps.exclude = []);
|
|
156
|
+
optimizeDeps.exclude = optimizeDeps.exclude.concat(domDeps.filter((dep) => import_path.default.extname(dep) === markoExt));
|
|
157
|
+
if (!isBuild) {
|
|
158
|
+
const serverDeps = Array.from(new Set(compiler.getRuntimeEntryFiles("html", opts.translator).concat(taglibDeps)));
|
|
161
159
|
const ssr = config.ssr ?? (config.ssr = {});
|
|
162
160
|
ssr.external ?? (ssr.external = []);
|
|
163
161
|
ssr.external = ssr.external.concat(serverDeps);
|
package/dist/index.mjs
CHANGED
|
@@ -97,30 +97,28 @@ function markoPlugin(opts = {}) {
|
|
|
97
97
|
"<body>": { transformer }
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const entry = tag.template || tag.renderer;
|
|
111
|
-
if (entry) {
|
|
112
|
-
taglibDeps.push(entry.replace(/^.*?[\\/]node_modules[\\/]/, ""));
|
|
113
|
-
}
|
|
100
|
+
const lookup = compiler.taglib.buildLookup(root);
|
|
101
|
+
const taglibDeps = [];
|
|
102
|
+
for (const name in lookup.taglibsById) {
|
|
103
|
+
const taglib = lookup.taglibsById[name];
|
|
104
|
+
if (/[\\/]node_modules[\\/](?!@marko[\\/])/.test(taglib.dirname)) {
|
|
105
|
+
for (const tagName in taglib.tags) {
|
|
106
|
+
const tag = taglib.tags[tagName];
|
|
107
|
+
const entry = tag.template || tag.renderer;
|
|
108
|
+
if (entry) {
|
|
109
|
+
taglibDeps.push(entry.replace(/^.*?[\\/]node_modules[\\/]/, ""));
|
|
114
110
|
}
|
|
115
111
|
}
|
|
116
112
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
113
|
+
}
|
|
114
|
+
const domDeps = Array.from(new Set(compiler.getRuntimeEntryFiles("dom", opts.translator).concat(taglibDeps)));
|
|
115
|
+
const optimizeDeps = config.optimizeDeps ?? (config.optimizeDeps = {});
|
|
116
|
+
optimizeDeps.include ?? (optimizeDeps.include = []);
|
|
117
|
+
optimizeDeps.include = optimizeDeps.include.concat(domDeps.filter((dep) => path.extname(dep) !== markoExt));
|
|
118
|
+
optimizeDeps.exclude ?? (optimizeDeps.exclude = []);
|
|
119
|
+
optimizeDeps.exclude = optimizeDeps.exclude.concat(domDeps.filter((dep) => path.extname(dep) === markoExt));
|
|
120
|
+
if (!isBuild) {
|
|
121
|
+
const serverDeps = Array.from(new Set(compiler.getRuntimeEntryFiles("html", opts.translator).concat(taglibDeps)));
|
|
124
122
|
const ssr = config.ssr ?? (config.ssr = {});
|
|
125
123
|
ssr.external ?? (ssr.external = []);
|
|
126
124
|
ssr.external = ssr.external.concat(serverDeps);
|