@deot/docs-playground 1.1.9 → 1.2.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/README.md +13 -4
- package/dist/{compile-no-AB7-B.js → compile-D33div4Y.js} +1 -1
- package/dist/{css-D47JLekg.js → css-sV_dM9Hl.js} +19 -7
- package/dist/index.js +68 -180
- package/package.json +4 -10
- package/dist/compile-yveCpyT3.cjs +0 -322
- package/dist/css-DGNVJsLz.cjs +0 -858
- package/dist/index.cjs +0 -4320
package/dist/css-DGNVJsLz.cjs
DELETED
|
@@ -1,858 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
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 __exportAll = (all, no_symbols) => {
|
|
9
|
-
let target = {};
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: true
|
|
13
|
-
});
|
|
14
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
-
return target;
|
|
16
|
-
};
|
|
17
|
-
var __copyProps = (to, from, except, desc) => {
|
|
18
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
-
key = keys[i];
|
|
20
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
-
get: ((k) => from[k]).bind(null, key),
|
|
22
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: true
|
|
30
|
-
}) : target, mod));
|
|
31
|
-
//#endregion
|
|
32
|
-
let vue = require("vue");
|
|
33
|
-
let sucrase = require("sucrase");
|
|
34
|
-
let _vue_compiler_sfc_dist_compiler_sfc_esm_browser_js = require("@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js");
|
|
35
|
-
_vue_compiler_sfc_dist_compiler_sfc_esm_browser_js = __toESM(_vue_compiler_sfc_dist_compiler_sfc_esm_browser_js);
|
|
36
|
-
//#region packages/playground/src/constants.ts
|
|
37
|
-
var DEFAULT_ENTRY = "App.vue";
|
|
38
|
-
/** 预览样式和默认 import map 共用的 npm CDN 前缀。 */
|
|
39
|
-
var DEFAULT_CDN_URL = "https://cdn.jsdelivr.net/npm";
|
|
40
|
-
var NEW_SFC_CODE = `<script setup lang="ts"><\/script>\n\n<template>\n <div>\n <slot />\n <\/div>\n<\/template>\n`;
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region packages/playground/src/cdn.ts
|
|
43
|
-
var DOCS_ESM_ENTRY = /^@deot\/docs-(?:client|locale|markdown|playground|renderer|theme)$/u;
|
|
44
|
-
var PREVIEW_STYLE_ASSETS = [
|
|
45
|
-
"@deot/style/dist/index.normalize-only.css",
|
|
46
|
-
"@deot/vc-components/dist/index.style.css",
|
|
47
|
-
"@deot/style/dist/index.css"
|
|
48
|
-
];
|
|
49
|
-
var BUILTIN_IMPORT_ASSETS = {
|
|
50
|
-
"@deot/vc": "@deot/vc/dist/index.js",
|
|
51
|
-
"@deot/vc-shared": "@deot/vc-shared/dist/index.js",
|
|
52
|
-
"@deot/vc-hooks": "@deot/vc-hooks/dist/index.js",
|
|
53
|
-
"@deot/vc-locale": "@deot/vc-locale/dist/index.js",
|
|
54
|
-
"@deot/vc-components": "@deot/vc-components/dist/index.js",
|
|
55
|
-
"@deot/helper-resize": "@deot/helper-resize/dist/index.js",
|
|
56
|
-
"@deot/helper-utils": "@deot/helper-utils/dist/index.js",
|
|
57
|
-
"@deot/helper-cache": "@deot/helper-cache/dist/index.js",
|
|
58
|
-
"@deot/helper-fp": "@deot/helper-fp/dist/index.js",
|
|
59
|
-
"@deot/helper-dom": "@deot/helper-dom/dist/index.js",
|
|
60
|
-
"@deot/helper-wheel": "@deot/helper-wheel/dist/index.js",
|
|
61
|
-
"@deot/helper-validator": "@deot/helper-validator/dist/index.js",
|
|
62
|
-
"@deot/helper-load": "@deot/helper-load/dist/index.js",
|
|
63
|
-
"@deot/helper-scheduler": "@deot/helper-scheduler/dist/index.js",
|
|
64
|
-
"@deot/helper-emitter": "@deot/helper-emitter/dist/index.js",
|
|
65
|
-
"@deot/helper-is": "@deot/helper-is/dist/index.js",
|
|
66
|
-
"@deot/helper-device": "@deot/helper-device/dist/index.js",
|
|
67
|
-
"@deot/helper-route": "@deot/helper-route/dist/index.js",
|
|
68
|
-
"@deot/helper-unicode": "@deot/helper-unicode/dist/index.js",
|
|
69
|
-
"@deot/helper": "@deot/helper/dist/index.js",
|
|
70
|
-
"normalize-wheel": "normalize-wheel-es/dist/index.mjs",
|
|
71
|
-
"photoswipe": "photoswipe/dist/photoswipe.esm.js",
|
|
72
|
-
"photoswipe/lightbox": "photoswipe/dist/photoswipe-lightbox.esm.js",
|
|
73
|
-
"vue": "vue/dist/vue.runtime.esm-browser.js",
|
|
74
|
-
"vue/server-renderer": "vue/dist/server-renderer.esm-browser.js"
|
|
75
|
-
};
|
|
76
|
-
var normalizeCdnURL = (cdnURL = DEFAULT_CDN_URL) => {
|
|
77
|
-
return cdnURL.trim().replace(/\/+$/u, "") || "https://cdn.jsdelivr.net/npm";
|
|
78
|
-
};
|
|
79
|
-
var cdnJoin = (origin, asset) => `${origin}/${asset.replace(/^\/+/u, "")}`;
|
|
80
|
-
var jsdelivrEsmURL = (asset) => cdnJoin(DEFAULT_CDN_URL, asset);
|
|
81
|
-
var SASS_CDN_URL = jsdelivrEsmURL("sass/+esm");
|
|
82
|
-
var cdnAsset = (cdnURL, asset) => cdnJoin(normalizeCdnURL(cdnURL), asset);
|
|
83
|
-
var createBuiltinImports = (cdnURL = DEFAULT_CDN_URL) => ({
|
|
84
|
-
...Object.fromEntries(Object.entries(BUILTIN_IMPORT_ASSETS).map(([specifier, asset]) => [specifier, cdnAsset(cdnURL, asset)])),
|
|
85
|
-
"lodash-es": jsdelivrEsmURL("lodash-es/+esm")
|
|
86
|
-
});
|
|
87
|
-
var createBuiltinStyles = (cdnURL = DEFAULT_CDN_URL) => Object.fromEntries(PREVIEW_STYLE_ASSETS.map((asset) => [asset, cdnAsset(cdnURL, asset)]));
|
|
88
|
-
var resolveNpmImport = (specifier) => /^https?:\/\//.test(specifier) ? specifier : jsdelivrEsmURL(`${specifier}/+esm`);
|
|
89
|
-
var docsCdnConfig = () => globalThis.window?.$docs || {};
|
|
90
|
-
var npmCdnUrl = (value) => {
|
|
91
|
-
if (!/^https?:\/\//i.test(value)) return null;
|
|
92
|
-
const url = new URL(value);
|
|
93
|
-
const prefix = /(?:^|\.)jsdelivr\.net$/u.test(url.hostname) && url.pathname.startsWith("/npm/") ? "/npm/" : /^(?:esm\.)?unpkg\.com$/u.test(url.hostname) ? "/" : null;
|
|
94
|
-
if (!prefix) return null;
|
|
95
|
-
const asset = url.pathname.slice(prefix.length);
|
|
96
|
-
const match = asset.match(/^((?:@[^/]+\/)?[^/]+)(.*)$/u);
|
|
97
|
-
return match ? {
|
|
98
|
-
url,
|
|
99
|
-
asset,
|
|
100
|
-
name: match[1].replace(/@[^/@]+$/u, ""),
|
|
101
|
-
path: match[2]
|
|
102
|
-
} : null;
|
|
103
|
-
};
|
|
104
|
-
var cdnModuleName = (url) => {
|
|
105
|
-
const parsed = npmCdnUrl(url);
|
|
106
|
-
return parsed && (!parsed.path || parsed.path === "/+esm" || DOCS_ESM_ENTRY.test(parsed.name) && parsed.path === "/dist/index.js" || /^\/(?:es\d+|esnext)\/[^/]+\.m?js$/u.test(parsed.path)) ? parsed.name : null;
|
|
107
|
-
};
|
|
108
|
-
var isCdnEsmURL = (url) => /\/\+esm(?:[?#]|$)/u.test(url) || npmCdnUrl(url)?.url.hostname === "esm.unpkg.com";
|
|
109
|
-
var resolveCdnURL = (url, cdnURL, config = docsCdnConfig()) => {
|
|
110
|
-
const parsed = npmCdnUrl(url);
|
|
111
|
-
const target = config.runtime?.cdn || cdnURL;
|
|
112
|
-
let converted = url;
|
|
113
|
-
if (parsed && target) {
|
|
114
|
-
const origin = normalizeCdnURL(target);
|
|
115
|
-
const unpkg = new URL(origin).hostname === "esm.unpkg.com";
|
|
116
|
-
let asset = parsed.asset;
|
|
117
|
-
if (unpkg) {
|
|
118
|
-
asset = asset.replace(/\/\+esm$/u, "");
|
|
119
|
-
if (DOCS_ESM_ENTRY.test(parsed.name) && (!parsed.path || parsed.path === "/+esm")) asset += "/dist/index.js";
|
|
120
|
-
} else if (!parsed.path.endsWith("/+esm") && (!parsed.path || !/\.[^/]+$/u.test(parsed.path) || /unpkg\.com$/u.test(parsed.url.hostname) && /\.[cm]?[jt]sx?$/u.test(parsed.path))) asset = `${asset.replace(/\/+$/u, "")}/+esm`;
|
|
121
|
-
converted = `${origin}/${asset}${parsed.url.search}${parsed.url.hash}`;
|
|
122
|
-
}
|
|
123
|
-
return config.resolve?.cdn?.({ url: converted }) || converted;
|
|
124
|
-
};
|
|
125
|
-
var createCdnResolver = (cdnURL) => {
|
|
126
|
-
const resolved = /* @__PURE__ */ new Map();
|
|
127
|
-
return (url) => {
|
|
128
|
-
if (!resolved.has(url)) {
|
|
129
|
-
const target = resolveCdnURL(url, cdnURL);
|
|
130
|
-
resolved.set(url, target);
|
|
131
|
-
resolved.set(target, target);
|
|
132
|
-
}
|
|
133
|
-
return resolved.get(url);
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
//#endregion
|
|
137
|
-
//#region packages/playground/src/core/scss.ts
|
|
138
|
-
var SCHEME = "docs-playground";
|
|
139
|
-
var STYLE_EXTS = [".scss", ".sass"];
|
|
140
|
-
var VUE_SCSS_STYLE_RE = /<style\b[^>]*\blang\s*=\s*(['"]?)s[ac]ss\1/i;
|
|
141
|
-
var LANG_ATTR_RE = /\s*lang\s*=\s*(['"]?)s[ac]ss\1/i;
|
|
142
|
-
var SCSS_ERROR_MARK = "[playground-sass]";
|
|
143
|
-
var INJECT_START = "/* docs-playground-scss-start */";
|
|
144
|
-
var INJECT_END = "/* docs-playground-scss-end */";
|
|
145
|
-
var boundStores = /* @__PURE__ */ new WeakSet();
|
|
146
|
-
var wrappedCompilers = /* @__PURE__ */ new WeakSet();
|
|
147
|
-
var testLoader;
|
|
148
|
-
var loadedSass;
|
|
149
|
-
var loadPromise;
|
|
150
|
-
var fileCode = (value) => typeof value === "string" ? value : value.code;
|
|
151
|
-
var playgroundPath = (url) => decodeURIComponent(url.pathname.replace(/^\/+/u, ""));
|
|
152
|
-
var toPlaygroundUrl = (filename) => new URL(`${SCHEME}:///${filename.replace(/^\/+/u, "")}`);
|
|
153
|
-
var basename$1 = (path) => path.split("/").pop() || path;
|
|
154
|
-
var scssSyntax = (filename, lang) => lang === "sass" || /\.sass$/i.test(filename) ? "indented" : "scss";
|
|
155
|
-
var errorText = (item) => item instanceof Error ? item.message : String(item);
|
|
156
|
-
var isScssFile = (filename) => /\.s[ac]ss$/i.test(filename);
|
|
157
|
-
var vueSourceNeedsScss = (source) => VUE_SCSS_STYLE_RE.test(source);
|
|
158
|
-
var resolveSassModule = async (url) => {
|
|
159
|
-
const mod = await import(
|
|
160
|
-
/* @vite-ignore */
|
|
161
|
-
url
|
|
162
|
-
);
|
|
163
|
-
const sass = typeof mod.compileString === "function" ? mod : mod.default;
|
|
164
|
-
if (typeof sass?.compileString !== "function") throw new Error(`Sass module at ${url} does not export compileString`);
|
|
165
|
-
return sass;
|
|
166
|
-
};
|
|
167
|
-
var loadSass = () => {
|
|
168
|
-
loadPromise ??= (testLoader ?? (() => resolveSassModule(resolveCdnURL(SASS_CDN_URL))))().then((sass) => {
|
|
169
|
-
loadedSass = sass;
|
|
170
|
-
return sass;
|
|
171
|
-
});
|
|
172
|
-
return loadPromise;
|
|
173
|
-
};
|
|
174
|
-
var isScssPartial = (filename) => isScssFile(filename) && basename$1(filename).startsWith("_");
|
|
175
|
-
var filesNeedScss = (files) => Object.entries(files).some(([filename, value]) => isScssFile(filename) || /\.vue$/i.test(filename) && vueSourceNeedsScss(fileCode(value)));
|
|
176
|
-
var whenSassReady = (files, run) => {
|
|
177
|
-
if (!filesNeedScss(files) || loadedSass) run();
|
|
178
|
-
else loadSass().then(run);
|
|
179
|
-
};
|
|
180
|
-
var toPlaygroundFileMap = (files) => Object.fromEntries(Object.entries(files).map(([filename, value]) => [filename, fileCode(value)]));
|
|
181
|
-
var formatScssError = (filename, message) => `${SCSS_ERROR_MARK} ${filename}: ${message}`;
|
|
182
|
-
var scssFail = (filename, error) => formatScssError(filename, errorText(error));
|
|
183
|
-
var withUnderscore = (path) => {
|
|
184
|
-
const base = basename$1(path);
|
|
185
|
-
if (base.startsWith("_")) return path;
|
|
186
|
-
return `${path.slice(0, -base.length)}_${base}`;
|
|
187
|
-
};
|
|
188
|
-
var matchFileKey = (files, path) => [
|
|
189
|
-
path,
|
|
190
|
-
path.startsWith("src/") ? path : `src/${path}`,
|
|
191
|
-
path.replace(/^src\//u, "")
|
|
192
|
-
].find((key) => files[key] !== void 0);
|
|
193
|
-
var stylesheetCandidates = (requestPath) => {
|
|
194
|
-
if (isScssFile(requestPath)) return [requestPath, withUnderscore(requestPath)];
|
|
195
|
-
return STYLE_EXTS.flatMap((ext) => [
|
|
196
|
-
`${requestPath}${ext}`,
|
|
197
|
-
withUnderscore(`${requestPath}${ext}`),
|
|
198
|
-
`${requestPath}/index${ext}`,
|
|
199
|
-
withUnderscore(`${requestPath}/index${ext}`)
|
|
200
|
-
]);
|
|
201
|
-
};
|
|
202
|
-
var resolvePlaygroundStylesheet = (files, requestPath) => {
|
|
203
|
-
const found = [...new Set(stylesheetCandidates(requestPath).map((path) => matchFileKey(files, path)).filter((key) => Boolean(key)))];
|
|
204
|
-
if (found.length > 1) throw new Error(`Ambiguous Sass import "${requestPath}": ${found.join(", ")}`);
|
|
205
|
-
return found[0] ?? null;
|
|
206
|
-
};
|
|
207
|
-
var createPlaygroundImporter = (getFiles) => ({
|
|
208
|
-
canonicalize(url, context) {
|
|
209
|
-
if (/^[a-zA-Z][\w+.-]*:/u.test(url) && !url.startsWith(`${SCHEME}:`)) return null;
|
|
210
|
-
try {
|
|
211
|
-
const resolved = resolvePlaygroundStylesheet(getFiles(), playgroundPath(new URL(url, context.containingUrl ?? toPlaygroundUrl(""))));
|
|
212
|
-
return resolved ? toPlaygroundUrl(resolved) : null;
|
|
213
|
-
} catch {
|
|
214
|
-
return null;
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
load(canonicalUrl) {
|
|
218
|
-
const files = getFiles();
|
|
219
|
-
const key = playgroundPath(canonicalUrl);
|
|
220
|
-
return files[key] === void 0 ? null : {
|
|
221
|
-
contents: files[key],
|
|
222
|
-
syntax: scssSyntax(key)
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
var compileScssSource = (source, filename, sass, files, lang) => {
|
|
227
|
-
const importer = createPlaygroundImporter(() => files);
|
|
228
|
-
return sass.compileString(source, {
|
|
229
|
-
syntax: scssSyntax(filename, lang),
|
|
230
|
-
url: toPlaygroundUrl(filename),
|
|
231
|
-
importer,
|
|
232
|
-
importers: [importer]
|
|
233
|
-
}).css;
|
|
234
|
-
};
|
|
235
|
-
var rewriteVueSfcStyles = (source, filename, parse, sass, files) => {
|
|
236
|
-
const scssStyles = parse(source, { filename }).descriptor.styles.filter((style) => style.lang === "scss" || style.lang === "sass");
|
|
237
|
-
if (!scssStyles.length) return {
|
|
238
|
-
code: source,
|
|
239
|
-
errors: []
|
|
240
|
-
};
|
|
241
|
-
const errors = [];
|
|
242
|
-
let code = source;
|
|
243
|
-
for (const style of [...scssStyles].sort((left, right) => right.loc.start.offset - left.loc.start.offset)) {
|
|
244
|
-
const before = code.slice(0, style.loc.start.offset);
|
|
245
|
-
const after = code.slice(style.loc.end.offset);
|
|
246
|
-
const openStart = before.lastIndexOf("<style");
|
|
247
|
-
if (openStart < 0) {
|
|
248
|
-
errors.push(formatScssError(filename, "unable to locate <style> opening tag"));
|
|
249
|
-
continue;
|
|
250
|
-
}
|
|
251
|
-
try {
|
|
252
|
-
const css = compileScssSource(style.content, filename, sass, files, style.lang);
|
|
253
|
-
code = `${before.slice(0, openStart)}${before.slice(openStart).replace(LANG_ATTR_RE, "")}${css}${after}`;
|
|
254
|
-
} catch (error) {
|
|
255
|
-
errors.push(scssFail(filename, error));
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return {
|
|
259
|
-
code,
|
|
260
|
-
errors
|
|
261
|
-
};
|
|
262
|
-
};
|
|
263
|
-
var appendParseErrors = (result, errors) => errors.length ? {
|
|
264
|
-
...result,
|
|
265
|
-
errors: [...result.errors, ...errors.map((item) => new Error(item))]
|
|
266
|
-
} : result;
|
|
267
|
-
var wrapCompiler = (compiler, getFiles) => {
|
|
268
|
-
if (wrappedCompilers.has(compiler)) return compiler;
|
|
269
|
-
const originalParse = compiler.parse.bind(compiler);
|
|
270
|
-
const wrapped = { ...compiler };
|
|
271
|
-
wrapped.parse = ((source, options) => {
|
|
272
|
-
const filename = options?.filename || "anonymous.vue";
|
|
273
|
-
if (!vueSourceNeedsScss(source)) return originalParse(source, options);
|
|
274
|
-
const rewritten = loadedSass ? rewriteVueSfcStyles(source, filename, originalParse, loadedSass, getFiles()) : {
|
|
275
|
-
code: source,
|
|
276
|
-
errors: [formatScssError(filename, "compiler is not loaded")]
|
|
277
|
-
};
|
|
278
|
-
return appendParseErrors(originalParse(rewritten.errors.length ? source : rewritten.code, options), rewritten.errors);
|
|
279
|
-
});
|
|
280
|
-
wrappedCompilers.add(wrapped);
|
|
281
|
-
return wrapped;
|
|
282
|
-
};
|
|
283
|
-
var withInjectedCss = (css, extra) => {
|
|
284
|
-
const start = css.indexOf(INJECT_START);
|
|
285
|
-
const end = start < 0 ? -1 : css.indexOf(INJECT_END, start);
|
|
286
|
-
const base = (start < 0 ? css : `${css.slice(0, start)}${end >= 0 ? css.slice(end + 30) : ""}`).trimEnd();
|
|
287
|
-
if (!extra.trim()) return base;
|
|
288
|
-
const block = `${INJECT_START}\n${extra.trim()}\n${INJECT_END}`;
|
|
289
|
-
return base ? `${base}\n${block}` : block;
|
|
290
|
-
};
|
|
291
|
-
var isStandaloneScssError = (item) => {
|
|
292
|
-
const text = errorText(item);
|
|
293
|
-
return text.startsWith(SCSS_ERROR_MARK) && /\.s[ac]ss:/i.test(text);
|
|
294
|
-
};
|
|
295
|
-
var syncScssErrors = (store, scssErrors) => {
|
|
296
|
-
const next = [...scssErrors, ...store.errors.filter((item) => !isStandaloneScssError(item))];
|
|
297
|
-
if (next.map(String).join("\0") === store.errors.map(String).join("\0")) return;
|
|
298
|
-
store.errors = next;
|
|
299
|
-
};
|
|
300
|
-
var extractScssExports = (css, filename) => {
|
|
301
|
-
const exports = {};
|
|
302
|
-
if (/\.module\.(?:scss|sass)$/.test(filename)) css = css.replace(/:export\s*\{([^}]*)\}/g, (_block, declarations) => {
|
|
303
|
-
for (const declaration of declarations.split(";")) {
|
|
304
|
-
const colon = declaration.indexOf(":");
|
|
305
|
-
if (colon >= 0) exports[declaration.slice(0, colon).trim()] = declaration.slice(colon + 1).trim();
|
|
306
|
-
}
|
|
307
|
-
return "";
|
|
308
|
-
});
|
|
309
|
-
return {
|
|
310
|
-
css,
|
|
311
|
-
exports
|
|
312
|
-
};
|
|
313
|
-
};
|
|
314
|
-
var applyStandaloneScss = (store, sass = loadedSass) => {
|
|
315
|
-
if (!sass) return [];
|
|
316
|
-
const fileMap = toPlaygroundFileMap(store.files);
|
|
317
|
-
const errors = [];
|
|
318
|
-
const injected = [];
|
|
319
|
-
for (const [filename, file] of Object.entries(store.files)) {
|
|
320
|
-
if (!isScssFile(filename) || !file.compiled) continue;
|
|
321
|
-
try {
|
|
322
|
-
const { css, exports } = extractScssExports(compileScssSource(file.code, filename, sass, fileMap), filename);
|
|
323
|
-
file.compiled.css = css;
|
|
324
|
-
file.compiled.js = file.compiled.ssr = `export default ${JSON.stringify(exports)};\n`;
|
|
325
|
-
if (!isScssPartial(filename) && css.trim()) injected.push(css);
|
|
326
|
-
} catch (error) {
|
|
327
|
-
errors.push(scssFail(filename, error));
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
const main = store.files[store.mainFile];
|
|
331
|
-
if (main?.compiled) {
|
|
332
|
-
const next = withInjectedCss(main.compiled.css || "", injected.join("\n"));
|
|
333
|
-
if (next !== (main.compiled.css || "")) main.compiled.css = next;
|
|
334
|
-
}
|
|
335
|
-
syncScssErrors(store, errors);
|
|
336
|
-
return errors;
|
|
337
|
-
};
|
|
338
|
-
var bindPlaygroundScss = (store) => {
|
|
339
|
-
if (boundStores.has(store)) return;
|
|
340
|
-
boundStores.add(store);
|
|
341
|
-
const getFiles = () => toPlaygroundFileMap(store.files);
|
|
342
|
-
const installCompiler = () => {
|
|
343
|
-
if (typeof store.compiler?.parse === "function") store.compiler = wrapCompiler(store.compiler, getFiles);
|
|
344
|
-
};
|
|
345
|
-
installCompiler();
|
|
346
|
-
(0, vue.watch)(() => store.compiler, installCompiler);
|
|
347
|
-
(0, vue.watch)(() => [
|
|
348
|
-
store.mainFile,
|
|
349
|
-
store.files[store.mainFile]?.compiled?.css,
|
|
350
|
-
store.errors.map(String).join("\0"),
|
|
351
|
-
Object.entries(store.files).filter(([filename]) => isScssFile(filename)).map(([filename, file]) => `${filename}:${file.code}`).join("\n")
|
|
352
|
-
].join("\0"), () => {
|
|
353
|
-
if (loadedSass) applyStandaloneScss(store);
|
|
354
|
-
});
|
|
355
|
-
const originalSetFiles = store.setFiles.bind(store);
|
|
356
|
-
store.setFiles = async (newFiles, mainFile) => {
|
|
357
|
-
if (filesNeedScss(newFiles) && !loadedSass) await loadSass();
|
|
358
|
-
return originalSetFiles(newFiles, mainFile);
|
|
359
|
-
};
|
|
360
|
-
};
|
|
361
|
-
//#endregion
|
|
362
|
-
//#region packages/playground/src/core/runtime/local/compile/types.ts
|
|
363
|
-
var IGNORED_FILENAMES = /* @__PURE__ */ new Set(["import-map.json", "tsconfig.json"]);
|
|
364
|
-
//#endregion
|
|
365
|
-
//#region packages/playground/src/core/runtime/local/compile/files.ts
|
|
366
|
-
/**
|
|
367
|
-
* 统一成以 `/` 开头的 POSIX 绝对虚拟路径。
|
|
368
|
-
* `App.vue` 与 `/App.vue` 是同一文件,和 iframe 预览使用的 files 键一致。
|
|
369
|
-
* @param filename Playground files 的键或相对路径。
|
|
370
|
-
* @returns 以 `/` 开头的虚拟路径。
|
|
371
|
-
*/
|
|
372
|
-
var normalizeVirtualPath = (filename) => {
|
|
373
|
-
const raw = String(filename || "").replace(/\\/gu, "/").trim();
|
|
374
|
-
if (!raw) return "/";
|
|
375
|
-
const parts = (raw.startsWith("/") ? raw : `/${raw}`).split("/");
|
|
376
|
-
const stack = [];
|
|
377
|
-
for (const part of parts) {
|
|
378
|
-
if (!part || part === ".") continue;
|
|
379
|
-
if (part === "..") {
|
|
380
|
-
if (stack.length) stack.pop();
|
|
381
|
-
continue;
|
|
382
|
-
}
|
|
383
|
-
stack.push(part);
|
|
384
|
-
}
|
|
385
|
-
return `/${stack.join("/")}`;
|
|
386
|
-
};
|
|
387
|
-
var dirname = (filename) => {
|
|
388
|
-
const path = normalizeVirtualPath(filename);
|
|
389
|
-
const index = path.lastIndexOf("/");
|
|
390
|
-
if (index <= 0) return "/";
|
|
391
|
-
return path.slice(0, index) || "/";
|
|
392
|
-
};
|
|
393
|
-
var basename = (filename) => {
|
|
394
|
-
const path = normalizeVirtualPath(filename);
|
|
395
|
-
const index = path.lastIndexOf("/");
|
|
396
|
-
return index === -1 ? path : path.slice(index + 1);
|
|
397
|
-
};
|
|
398
|
-
var joinVirtualPath = (baseDir, relative) => {
|
|
399
|
-
const rel = String(relative || "").replace(/\\/gu, "/");
|
|
400
|
-
if (rel.startsWith("/")) return normalizeVirtualPath(rel);
|
|
401
|
-
const base = normalizeVirtualPath(baseDir);
|
|
402
|
-
return normalizeVirtualPath(`${base === "/" ? "" : base}/${rel}`);
|
|
403
|
-
};
|
|
404
|
-
var getExtension = (filename) => {
|
|
405
|
-
const name = basename(filename);
|
|
406
|
-
const index = name.lastIndexOf(".");
|
|
407
|
-
if (index <= 0) return "";
|
|
408
|
-
return name.slice(index).toLowerCase();
|
|
409
|
-
};
|
|
410
|
-
var isIgnoredFilename = (filename) => IGNORED_FILENAMES.has(basename(filename));
|
|
411
|
-
var createFileIndex = (files) => {
|
|
412
|
-
const index = /* @__PURE__ */ new Map();
|
|
413
|
-
Object.entries(files || {}).forEach(([filename, code]) => {
|
|
414
|
-
const normalized = normalizeVirtualPath(filename);
|
|
415
|
-
if (isIgnoredFilename(normalized)) return;
|
|
416
|
-
index.set(normalized, code);
|
|
417
|
-
});
|
|
418
|
-
return index;
|
|
419
|
-
};
|
|
420
|
-
var resolveEntry = (files, entry) => {
|
|
421
|
-
const index = createFileIndex(files);
|
|
422
|
-
if (!index.size) throw new Error("[Playground] files 为空,无法确定入口");
|
|
423
|
-
if (entry) {
|
|
424
|
-
const normalized = normalizeVirtualPath(entry);
|
|
425
|
-
if (isIgnoredFilename(normalized)) throw new Error(`[Playground] entry 不能是 ${basename(normalized)}`);
|
|
426
|
-
if (!index.has(normalized)) throw new Error(`[Playground] entry 不在 files 中: ${entry}`);
|
|
427
|
-
return normalized;
|
|
428
|
-
}
|
|
429
|
-
for (const key of Object.keys(files || {})) {
|
|
430
|
-
const normalized = normalizeVirtualPath(key);
|
|
431
|
-
if (!isIgnoredFilename(normalized) && index.has(normalized)) return normalized;
|
|
432
|
-
}
|
|
433
|
-
/* istanbul ignore next -- 忽略文件已在前面排除,正常 files 不会走到这里 */
|
|
434
|
-
throw new Error("[Playground] files 中没有可用的入口文件");
|
|
435
|
-
};
|
|
436
|
-
var CANDIDATE_EXTENSIONS = [
|
|
437
|
-
".vue",
|
|
438
|
-
".ts",
|
|
439
|
-
".js",
|
|
440
|
-
".tsx",
|
|
441
|
-
".jsx",
|
|
442
|
-
".json",
|
|
443
|
-
".css",
|
|
444
|
-
".scss",
|
|
445
|
-
".sass"
|
|
446
|
-
];
|
|
447
|
-
/**
|
|
448
|
-
* 相对 / 无扩展名解析,行为对齐 Vite:精确路径、补扩展名、`/index.*`。
|
|
449
|
-
* @param fromFilename 发起导入的文件。
|
|
450
|
-
* @param specifier 相对或绝对虚拟路径。
|
|
451
|
-
* @param fileIndex 虚拟路径到 files 键的索引。
|
|
452
|
-
* @returns 解析后的 files 键;找不到时返回 null。
|
|
453
|
-
*/
|
|
454
|
-
var resolveModulePath = (fromFilename, specifier, fileIndex) => {
|
|
455
|
-
if (!specifier || !(specifier === "." || specifier === ".." || specifier.startsWith("./") || specifier.startsWith("../") || specifier.startsWith("/"))) return null;
|
|
456
|
-
const target = joinVirtualPath(dirname(fromFilename), specifier);
|
|
457
|
-
if (fileIndex.has(target)) return target;
|
|
458
|
-
for (const ext of CANDIDATE_EXTENSIONS) {
|
|
459
|
-
const withExt = `${target}${ext}`;
|
|
460
|
-
if (fileIndex.has(withExt)) return withExt;
|
|
461
|
-
}
|
|
462
|
-
for (const ext of CANDIDATE_EXTENSIONS) {
|
|
463
|
-
const asIndex = `${target}/index${ext}`;
|
|
464
|
-
if (fileIndex.has(asIndex)) return asIndex;
|
|
465
|
-
}
|
|
466
|
-
return null;
|
|
467
|
-
};
|
|
468
|
-
var getCommonRoot = (filenames) => {
|
|
469
|
-
const normalized = filenames.map(normalizeVirtualPath);
|
|
470
|
-
if (!normalized.length) return "/";
|
|
471
|
-
const split = normalized.map((path) => path.split("/").filter(Boolean));
|
|
472
|
-
const first = split[0];
|
|
473
|
-
let depth = first.length;
|
|
474
|
-
for (let i = 1; i < split.length; i += 1) {
|
|
475
|
-
let common = 0;
|
|
476
|
-
while (common < depth && common < split[i].length && first[common] === split[i][common]) common += 1;
|
|
477
|
-
depth = common;
|
|
478
|
-
}
|
|
479
|
-
if (!depth) return "/";
|
|
480
|
-
const maybeFile = `/${first.slice(0, depth).join("/")}`;
|
|
481
|
-
if (normalized.some((path) => path === maybeFile)) return dirname(maybeFile);
|
|
482
|
-
return maybeFile;
|
|
483
|
-
};
|
|
484
|
-
var isInsideRoot = (filename, root) => {
|
|
485
|
-
const path = normalizeVirtualPath(filename);
|
|
486
|
-
const base = normalizeVirtualPath(root);
|
|
487
|
-
if (base === "/") return true;
|
|
488
|
-
return path === base || path.startsWith(`${base}/`);
|
|
489
|
-
};
|
|
490
|
-
/**
|
|
491
|
-
* 静态 import / export-from / import() 的模块说明符。
|
|
492
|
-
* @param code 源码文本。
|
|
493
|
-
* @returns 按出现顺序收集到的说明符。
|
|
494
|
-
*/
|
|
495
|
-
var listImportSpecifiers = (code) => {
|
|
496
|
-
const result = [];
|
|
497
|
-
const source = String(code || "");
|
|
498
|
-
for (const match of source.matchAll(/(?:\bfrom\s+|import\s*\(\s*|import\s+)['"]([^'"]+)['"]/gu)) if (match[1]) result.push(match[1]);
|
|
499
|
-
return result;
|
|
500
|
-
};
|
|
501
|
-
var isRelativeSpecifier = (id) => id === "." || id === ".." || id.startsWith("./") || id.startsWith("../") || id.startsWith("/");
|
|
502
|
-
/**
|
|
503
|
-
* 从入口出发只编译静态 import 能走到的文件。
|
|
504
|
-
* @param files 当前 Playground 文件表。
|
|
505
|
-
* @param entry 入口文件名。
|
|
506
|
-
* @returns 可达文件名,入口在最前。
|
|
507
|
-
*/
|
|
508
|
-
var collectReachableFilenames = (files, entry) => {
|
|
509
|
-
const index = createFileIndex(files);
|
|
510
|
-
const ordered = [];
|
|
511
|
-
const seen = /* @__PURE__ */ new Set();
|
|
512
|
-
const visit = (filename) => {
|
|
513
|
-
const key = normalizeVirtualPath(filename);
|
|
514
|
-
if (seen.has(key) || !index.has(key)) return;
|
|
515
|
-
seen.add(key);
|
|
516
|
-
ordered.push(key);
|
|
517
|
-
listImportSpecifiers(index.get(key) || "").forEach((specifier) => {
|
|
518
|
-
const resolved = resolveModulePath(key, specifier, index);
|
|
519
|
-
if (resolved) visit(resolved);
|
|
520
|
-
});
|
|
521
|
-
};
|
|
522
|
-
visit(entry);
|
|
523
|
-
return ordered;
|
|
524
|
-
};
|
|
525
|
-
var collectBareSpecifiers = (files, filenames) => {
|
|
526
|
-
const index = createFileIndex(files);
|
|
527
|
-
const result = [];
|
|
528
|
-
const seen = /* @__PURE__ */ new Set();
|
|
529
|
-
filenames.forEach((filename) => {
|
|
530
|
-
listImportSpecifiers(index.get(normalizeVirtualPath(filename)) || "").forEach((specifier) => {
|
|
531
|
-
if (!specifier || isRelativeSpecifier(specifier) || seen.has(specifier) || /\.(?:css|scss|sass)(?:[?#]|$)/.test(specifier)) return;
|
|
532
|
-
seen.add(specifier);
|
|
533
|
-
result.push(specifier);
|
|
534
|
-
});
|
|
535
|
-
});
|
|
536
|
-
return result;
|
|
537
|
-
};
|
|
538
|
-
//#endregion
|
|
539
|
-
//#region packages/playground/src/core/runtime/local/compile/script.ts
|
|
540
|
-
var { babelParse, walkIdentifiers, MagicString } = _vue_compiler_sfc_dist_compiler_sfc_esm_browser_js;
|
|
541
|
-
var rewriteJsxAttributes = (code) => {
|
|
542
|
-
const replacements = [];
|
|
543
|
-
for (const match of code.matchAll(/\b([\w-]+:[\w-]+)\s*=\s*\{/g)) {
|
|
544
|
-
let depth = 1;
|
|
545
|
-
let quote = "";
|
|
546
|
-
const start = match.index + match[0].length;
|
|
547
|
-
let end = start;
|
|
548
|
-
for (; end < code.length; end += 1) {
|
|
549
|
-
const character = code[end];
|
|
550
|
-
if (quote) {
|
|
551
|
-
if (character === "\\") end += 1;
|
|
552
|
-
else if (character === quote) quote = "";
|
|
553
|
-
} else if ("\"'`".includes(character)) quote = character;
|
|
554
|
-
else if (character === "{") depth += 1;
|
|
555
|
-
else if (character === "}" && --depth === 0) break;
|
|
556
|
-
}
|
|
557
|
-
replacements.push({
|
|
558
|
-
start: match.index,
|
|
559
|
-
end: end + 1,
|
|
560
|
-
text: `{...{${JSON.stringify(match[1])}: ${code.slice(start, end)}}}`
|
|
561
|
-
});
|
|
562
|
-
}
|
|
563
|
-
for (const item of replacements.reverse()) code = code.slice(0, item.start) + item.text + code.slice(item.end);
|
|
564
|
-
return code;
|
|
565
|
-
};
|
|
566
|
-
var removeImportedTypeExports = (code) => {
|
|
567
|
-
const types = /* @__PURE__ */ new Set();
|
|
568
|
-
for (const match of code.matchAll(/\bimport\s+type\s*\{([^}]+)\}\s*from\s*['"][^'"]+['"]/g)) for (const item of match[1].split(",")) types.add(item.trim().split(/\s+as\s+/).pop());
|
|
569
|
-
return code.replace(/\bexport\s*\{([^}]+)\}(?!\s*from)/g, (_statement, names) => `export {${names.split(",").filter((item) => !types.has(item.trim().split(/\s+as\s+/)[0])).join(",")}}`);
|
|
570
|
-
};
|
|
571
|
-
/**
|
|
572
|
-
* files 里的 `import.meta.env` 没有 Vite 注入,接到开发态占位对象上。
|
|
573
|
-
* @param code 源码文本。
|
|
574
|
-
* @param filename 当前虚拟文件名。
|
|
575
|
-
* @returns 替换 `import.meta` 之后的源码。
|
|
576
|
-
*/
|
|
577
|
-
var rewriteImportMeta = (code, filename) => {
|
|
578
|
-
if (!code.includes("process") && !code.includes("import.meta")) return code;
|
|
579
|
-
const source = new MagicString(code);
|
|
580
|
-
let hasMeta = false;
|
|
581
|
-
walkIdentifiers(babelParse(code, { sourceType: "module" }), (id, parent, parents) => {
|
|
582
|
-
if (id.name === "import" && parent?.type === "MetaProperty") {
|
|
583
|
-
source.overwrite(parent.start, parent.end, "import_meta");
|
|
584
|
-
hasMeta = true;
|
|
585
|
-
}
|
|
586
|
-
const outer = parents[parents.length - 2];
|
|
587
|
-
if (id.name === "process" && parent?.type === "MemberExpression" && parent.object === id && !parent.computed && parent.property.type === "Identifier" && parent.property.name === "env" && outer?.type === "MemberExpression" && outer.object === parent && !outer.computed && outer.property.type === "Identifier" && outer.property.name === "NODE_ENV") source.overwrite(outer.start, outer.end, JSON.stringify("development"));
|
|
588
|
-
}, true);
|
|
589
|
-
if (!hasMeta) return source.toString();
|
|
590
|
-
const meta = {
|
|
591
|
-
url: `playground://${filename}`,
|
|
592
|
-
env: {
|
|
593
|
-
MODE: "development",
|
|
594
|
-
DEV: true,
|
|
595
|
-
PROD: false,
|
|
596
|
-
SSR: false
|
|
597
|
-
}
|
|
598
|
-
};
|
|
599
|
-
return `var import_meta = ${JSON.stringify(meta)};\n${source}`;
|
|
600
|
-
};
|
|
601
|
-
/**
|
|
602
|
-
* 将 TS / ESM 转成可被 `new Function('require','module','exports', code)` 执行的 CJS。
|
|
603
|
-
* @param code 源码文本。
|
|
604
|
-
* @param filename 当前虚拟文件名,用来判断是否按 TypeScript 转换。
|
|
605
|
-
* @param options 转换选项。
|
|
606
|
-
* @param options.typescript 是否启用 TypeScript 转换。
|
|
607
|
-
* @param options.jsx 是否转换 Vue JSX。
|
|
608
|
-
* @param options.esm 是否保留 ESM 导入导出供 iframe 使用。
|
|
609
|
-
* @returns 可执行的 CJS 文本。
|
|
610
|
-
*/
|
|
611
|
-
var transformScript = (code, filename, options = {}) => {
|
|
612
|
-
const transforms = options.esm ? [] : ["imports"];
|
|
613
|
-
const wantTs = options.typescript === true || options.typescript !== false && (filename.endsWith(".ts") || filename.endsWith(".tsx"));
|
|
614
|
-
if (wantTs) transforms.unshift("typescript");
|
|
615
|
-
if (options.jsx) transforms.unshift("jsx");
|
|
616
|
-
try {
|
|
617
|
-
const script = wantTs ? removeImportedTypeExports(code) : code;
|
|
618
|
-
const source = options.jsx ? `import { h as __docs_h, Fragment as __docs_Fragment } from 'vue';\n${rewriteJsxAttributes(script)}` : script;
|
|
619
|
-
return `${rewriteImportMeta((0, sucrase.transform)(source, {
|
|
620
|
-
transforms,
|
|
621
|
-
disableESTransforms: true,
|
|
622
|
-
production: true,
|
|
623
|
-
jsxRuntime: "classic",
|
|
624
|
-
jsxPragma: "__docs_h",
|
|
625
|
-
jsxFragmentPragma: "__docs_Fragment",
|
|
626
|
-
filePath: filename
|
|
627
|
-
}).code, filename)}\n//# sourceURL=playground://${filename}`;
|
|
628
|
-
} catch (error) {
|
|
629
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
630
|
-
throw new Error(`[Playground] 脚本转换失败 ${filename}: ${message}`, { cause: error });
|
|
631
|
-
}
|
|
632
|
-
};
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region packages/playground/src/core/runtime/local/compile/css.ts
|
|
635
|
-
var collectCss = (chunks) => {
|
|
636
|
-
const result = [];
|
|
637
|
-
chunks.forEach((chunk) => {
|
|
638
|
-
const css = String(chunk || "").trim();
|
|
639
|
-
if (css) result.push(css);
|
|
640
|
-
});
|
|
641
|
-
return result;
|
|
642
|
-
};
|
|
643
|
-
var injectStyle = (id, cssList) => {
|
|
644
|
-
/* istanbul ignore if -- 仅浏览器注入样式 */
|
|
645
|
-
if (typeof document === "undefined") return null;
|
|
646
|
-
document.querySelector(`style[data-playground-id="${id}"]`)?.remove();
|
|
647
|
-
const css = cssList.filter(Boolean).join("\n");
|
|
648
|
-
if (!css) return null;
|
|
649
|
-
const style = document.createElement("style");
|
|
650
|
-
style.setAttribute("data-playground-id", id);
|
|
651
|
-
style.textContent = css;
|
|
652
|
-
document.head.appendChild(style);
|
|
653
|
-
return style;
|
|
654
|
-
};
|
|
655
|
-
var removeStyle = (id) => {
|
|
656
|
-
/* istanbul ignore if -- 仅浏览器注入样式 */
|
|
657
|
-
if (typeof document === "undefined") return;
|
|
658
|
-
document.querySelector(`style[data-playground-id="${id}"]`)?.remove();
|
|
659
|
-
};
|
|
660
|
-
//#endregion
|
|
661
|
-
Object.defineProperty(exports, "DEFAULT_CDN_URL", {
|
|
662
|
-
enumerable: true,
|
|
663
|
-
get: function() {
|
|
664
|
-
return DEFAULT_CDN_URL;
|
|
665
|
-
}
|
|
666
|
-
});
|
|
667
|
-
Object.defineProperty(exports, "DEFAULT_ENTRY", {
|
|
668
|
-
enumerable: true,
|
|
669
|
-
get: function() {
|
|
670
|
-
return DEFAULT_ENTRY;
|
|
671
|
-
}
|
|
672
|
-
});
|
|
673
|
-
Object.defineProperty(exports, "NEW_SFC_CODE", {
|
|
674
|
-
enumerable: true,
|
|
675
|
-
get: function() {
|
|
676
|
-
return NEW_SFC_CODE;
|
|
677
|
-
}
|
|
678
|
-
});
|
|
679
|
-
Object.defineProperty(exports, "__exportAll", {
|
|
680
|
-
enumerable: true,
|
|
681
|
-
get: function() {
|
|
682
|
-
return __exportAll;
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
Object.defineProperty(exports, "__toESM", {
|
|
686
|
-
enumerable: true,
|
|
687
|
-
get: function() {
|
|
688
|
-
return __toESM;
|
|
689
|
-
}
|
|
690
|
-
});
|
|
691
|
-
Object.defineProperty(exports, "bindPlaygroundScss", {
|
|
692
|
-
enumerable: true,
|
|
693
|
-
get: function() {
|
|
694
|
-
return bindPlaygroundScss;
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
Object.defineProperty(exports, "cdnModuleName", {
|
|
698
|
-
enumerable: true,
|
|
699
|
-
get: function() {
|
|
700
|
-
return cdnModuleName;
|
|
701
|
-
}
|
|
702
|
-
});
|
|
703
|
-
Object.defineProperty(exports, "collectBareSpecifiers", {
|
|
704
|
-
enumerable: true,
|
|
705
|
-
get: function() {
|
|
706
|
-
return collectBareSpecifiers;
|
|
707
|
-
}
|
|
708
|
-
});
|
|
709
|
-
Object.defineProperty(exports, "collectCss", {
|
|
710
|
-
enumerable: true,
|
|
711
|
-
get: function() {
|
|
712
|
-
return collectCss;
|
|
713
|
-
}
|
|
714
|
-
});
|
|
715
|
-
Object.defineProperty(exports, "collectReachableFilenames", {
|
|
716
|
-
enumerable: true,
|
|
717
|
-
get: function() {
|
|
718
|
-
return collectReachableFilenames;
|
|
719
|
-
}
|
|
720
|
-
});
|
|
721
|
-
Object.defineProperty(exports, "compileScssSource", {
|
|
722
|
-
enumerable: true,
|
|
723
|
-
get: function() {
|
|
724
|
-
return compileScssSource;
|
|
725
|
-
}
|
|
726
|
-
});
|
|
727
|
-
Object.defineProperty(exports, "createBuiltinImports", {
|
|
728
|
-
enumerable: true,
|
|
729
|
-
get: function() {
|
|
730
|
-
return createBuiltinImports;
|
|
731
|
-
}
|
|
732
|
-
});
|
|
733
|
-
Object.defineProperty(exports, "createBuiltinStyles", {
|
|
734
|
-
enumerable: true,
|
|
735
|
-
get: function() {
|
|
736
|
-
return createBuiltinStyles;
|
|
737
|
-
}
|
|
738
|
-
});
|
|
739
|
-
Object.defineProperty(exports, "createCdnResolver", {
|
|
740
|
-
enumerable: true,
|
|
741
|
-
get: function() {
|
|
742
|
-
return createCdnResolver;
|
|
743
|
-
}
|
|
744
|
-
});
|
|
745
|
-
Object.defineProperty(exports, "createFileIndex", {
|
|
746
|
-
enumerable: true,
|
|
747
|
-
get: function() {
|
|
748
|
-
return createFileIndex;
|
|
749
|
-
}
|
|
750
|
-
});
|
|
751
|
-
Object.defineProperty(exports, "extractScssExports", {
|
|
752
|
-
enumerable: true,
|
|
753
|
-
get: function() {
|
|
754
|
-
return extractScssExports;
|
|
755
|
-
}
|
|
756
|
-
});
|
|
757
|
-
Object.defineProperty(exports, "getCommonRoot", {
|
|
758
|
-
enumerable: true,
|
|
759
|
-
get: function() {
|
|
760
|
-
return getCommonRoot;
|
|
761
|
-
}
|
|
762
|
-
});
|
|
763
|
-
Object.defineProperty(exports, "getExtension", {
|
|
764
|
-
enumerable: true,
|
|
765
|
-
get: function() {
|
|
766
|
-
return getExtension;
|
|
767
|
-
}
|
|
768
|
-
});
|
|
769
|
-
Object.defineProperty(exports, "injectStyle", {
|
|
770
|
-
enumerable: true,
|
|
771
|
-
get: function() {
|
|
772
|
-
return injectStyle;
|
|
773
|
-
}
|
|
774
|
-
});
|
|
775
|
-
Object.defineProperty(exports, "isCdnEsmURL", {
|
|
776
|
-
enumerable: true,
|
|
777
|
-
get: function() {
|
|
778
|
-
return isCdnEsmURL;
|
|
779
|
-
}
|
|
780
|
-
});
|
|
781
|
-
Object.defineProperty(exports, "isIgnoredFilename", {
|
|
782
|
-
enumerable: true,
|
|
783
|
-
get: function() {
|
|
784
|
-
return isIgnoredFilename;
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
|
-
Object.defineProperty(exports, "isInsideRoot", {
|
|
788
|
-
enumerable: true,
|
|
789
|
-
get: function() {
|
|
790
|
-
return isInsideRoot;
|
|
791
|
-
}
|
|
792
|
-
});
|
|
793
|
-
Object.defineProperty(exports, "isRelativeSpecifier", {
|
|
794
|
-
enumerable: true,
|
|
795
|
-
get: function() {
|
|
796
|
-
return isRelativeSpecifier;
|
|
797
|
-
}
|
|
798
|
-
});
|
|
799
|
-
Object.defineProperty(exports, "normalizeCdnURL", {
|
|
800
|
-
enumerable: true,
|
|
801
|
-
get: function() {
|
|
802
|
-
return normalizeCdnURL;
|
|
803
|
-
}
|
|
804
|
-
});
|
|
805
|
-
Object.defineProperty(exports, "normalizeVirtualPath", {
|
|
806
|
-
enumerable: true,
|
|
807
|
-
get: function() {
|
|
808
|
-
return normalizeVirtualPath;
|
|
809
|
-
}
|
|
810
|
-
});
|
|
811
|
-
Object.defineProperty(exports, "removeStyle", {
|
|
812
|
-
enumerable: true,
|
|
813
|
-
get: function() {
|
|
814
|
-
return removeStyle;
|
|
815
|
-
}
|
|
816
|
-
});
|
|
817
|
-
Object.defineProperty(exports, "resolveCdnURL", {
|
|
818
|
-
enumerable: true,
|
|
819
|
-
get: function() {
|
|
820
|
-
return resolveCdnURL;
|
|
821
|
-
}
|
|
822
|
-
});
|
|
823
|
-
Object.defineProperty(exports, "resolveEntry", {
|
|
824
|
-
enumerable: true,
|
|
825
|
-
get: function() {
|
|
826
|
-
return resolveEntry;
|
|
827
|
-
}
|
|
828
|
-
});
|
|
829
|
-
Object.defineProperty(exports, "resolveModulePath", {
|
|
830
|
-
enumerable: true,
|
|
831
|
-
get: function() {
|
|
832
|
-
return resolveModulePath;
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
Object.defineProperty(exports, "resolveNpmImport", {
|
|
836
|
-
enumerable: true,
|
|
837
|
-
get: function() {
|
|
838
|
-
return resolveNpmImport;
|
|
839
|
-
}
|
|
840
|
-
});
|
|
841
|
-
Object.defineProperty(exports, "rewriteImportMeta", {
|
|
842
|
-
enumerable: true,
|
|
843
|
-
get: function() {
|
|
844
|
-
return rewriteImportMeta;
|
|
845
|
-
}
|
|
846
|
-
});
|
|
847
|
-
Object.defineProperty(exports, "transformScript", {
|
|
848
|
-
enumerable: true,
|
|
849
|
-
get: function() {
|
|
850
|
-
return transformScript;
|
|
851
|
-
}
|
|
852
|
-
});
|
|
853
|
-
Object.defineProperty(exports, "whenSassReady", {
|
|
854
|
-
enumerable: true,
|
|
855
|
-
get: function() {
|
|
856
|
-
return whenSassReady;
|
|
857
|
-
}
|
|
858
|
-
});
|