Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
33
Frontend-Learner/node_modules/unctx/dist/plugin.mjs
generated
vendored
Normal file
33
Frontend-Learner/node_modules/unctx/dist/plugin.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { createUnplugin } from 'unplugin';
|
||||
import { createTransformer } from './transform.mjs';
|
||||
import 'acorn';
|
||||
import 'magic-string';
|
||||
import 'estree-walker';
|
||||
|
||||
const unctxPlugin = createUnplugin(
|
||||
(options = {}) => {
|
||||
const transformer = createTransformer(options);
|
||||
return {
|
||||
name: "unctx:transform",
|
||||
enforce: "post",
|
||||
transformInclude: options.transformInclude,
|
||||
transform: {
|
||||
filter: options.transformFilter ?? transformer.filter,
|
||||
handler(code, id) {
|
||||
const result = transformer.transform(code);
|
||||
if (result) {
|
||||
return {
|
||||
code: result.code,
|
||||
map: result.magicString.generateMap({
|
||||
source: id,
|
||||
includeContent: true
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
export { unctxPlugin };
|
||||
Loading…
Add table
Add a link
Reference in a new issue