unplugin-tailwindcss-mangle 1.2.6 → 2.0.0

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.mjs CHANGED
@@ -1,364 +1,335 @@
1
1
  import { createUnplugin } from 'unplugin';
2
- import micromatch from 'micromatch';
3
2
  import fs from 'node:fs';
4
- import path from 'node:path';
5
- import { groupBy, defaultMangleClassFilter } from 'tailwindcss-mangle-shared';
6
- export { defaultMangleClassFilter } from 'tailwindcss-mangle-shared';
7
- import { ClassGenerator, htmlHandler, jsHandler, cssHandler } from 'tailwindcss-mangle-core';
8
- import { TailwindcssPatcher } from 'tailwindcss-patch';
9
-
10
- const pluginName = 'unplugin-tailwindcss-mangle';
3
+ import path, { resolve } from 'node:path';
4
+ import { groupBy, ClassGenerator, defaultMangleClassFilter } from '@tailwindcss-mangle/shared';
5
+ import { getDefaultUserConfig, getConfig } from '@tailwindcss-mangle/config';
6
+ import { sort } from 'fast-sort';
7
+ import { htmlHandler, cssHandler, jsHandler, preProcessJs } from '@tailwindcss-mangle/core';
8
+ import micromatch from 'micromatch';
11
9
 
12
- const { isMatch } = micromatch;
13
- function getGroupedEntries(entries, options = {
14
- cssMatcher(file) {
15
- return /\.css$/.test(file);
16
- },
17
- htmlMatcher(file) {
18
- return /\.html?$/.test(file);
19
- },
20
- jsMatcher(file) {
21
- return /\.[cm]?js$/.test(file);
10
+ function isObject(value) {
11
+ return value !== null && typeof value === "object";
12
+ }
13
+ function _defu(baseObject, defaults, namespace = ".", merger) {
14
+ if (!isObject(defaults)) {
15
+ return _defu(baseObject, {}, namespace, merger);
16
+ }
17
+ const object = Object.assign({}, defaults);
18
+ for (const key in baseObject) {
19
+ if (key === "__proto__" || key === "constructor") {
20
+ continue;
22
21
  }
23
- }) {
24
- const { cssMatcher, htmlMatcher, jsMatcher } = options;
25
- const groupedEntries = groupBy(entries, ([file]) => {
26
- if (cssMatcher(file)) {
27
- return 'css';
28
- }
29
- else if (htmlMatcher(file)) {
30
- return 'html';
31
- }
32
- else if (jsMatcher(file)) {
33
- return 'js';
34
- }
35
- else {
36
- return 'other';
37
- }
38
- });
39
- if (!groupedEntries.css) {
40
- groupedEntries.css = [];
22
+ const value = baseObject[key];
23
+ if (value === null || value === void 0) {
24
+ continue;
41
25
  }
42
- if (!groupedEntries.html) {
43
- groupedEntries.html = [];
26
+ if (merger && merger(object, key, value, namespace)) {
27
+ continue;
44
28
  }
45
- if (!groupedEntries.js) {
46
- groupedEntries.js = [];
29
+ if (Array.isArray(value) && Array.isArray(object[key])) {
30
+ object[key] = [...value, ...object[key]];
31
+ } else if (isObject(value) && isObject(object[key])) {
32
+ object[key] = _defu(
33
+ value,
34
+ object[key],
35
+ (namespace ? `${namespace}.` : "") + key.toString(),
36
+ merger
37
+ );
38
+ } else {
39
+ object[key] = value;
47
40
  }
48
- if (!groupedEntries.other) {
49
- groupedEntries.other = [];
41
+ }
42
+ return object;
43
+ }
44
+ function createDefu(merger) {
45
+ return (...arguments_) => (
46
+ // eslint-disable-next-line unicorn/no-array-reduce
47
+ arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
48
+ );
49
+ }
50
+ const defu = createDefu();
51
+
52
+ const pluginName = "unplugin-tailwindcss-mangle";
53
+
54
+ const { isMatch } = micromatch;
55
+ function getGroupedEntries(entries, options = {
56
+ cssMatcher(file) {
57
+ return /\.css$/.test(file);
58
+ },
59
+ htmlMatcher(file) {
60
+ return /\.html?$/.test(file);
61
+ },
62
+ jsMatcher(file) {
63
+ return /\.[cm]?js$/.test(file);
64
+ }
65
+ }) {
66
+ const { cssMatcher, htmlMatcher, jsMatcher } = options;
67
+ const groupedEntries = groupBy(entries, ([file]) => {
68
+ if (cssMatcher(file)) {
69
+ return "css";
70
+ } else if (htmlMatcher(file)) {
71
+ return "html";
72
+ } else if (jsMatcher(file)) {
73
+ return "js";
74
+ } else {
75
+ return "other";
50
76
  }
51
- return groupedEntries;
77
+ });
78
+ if (!groupedEntries.css) {
79
+ groupedEntries.css = [];
80
+ }
81
+ if (!groupedEntries.html) {
82
+ groupedEntries.html = [];
83
+ }
84
+ if (!groupedEntries.js) {
85
+ groupedEntries.js = [];
86
+ }
87
+ if (!groupedEntries.other) {
88
+ groupedEntries.other = [];
89
+ }
90
+ return groupedEntries;
52
91
  }
53
92
  function createGlobMatcher(pattern, fallbackValue = false) {
54
- if (pattern === undefined) {
55
- return function (file) {
56
- return fallbackValue;
57
- };
58
- }
59
- return function (file) {
60
- return isMatch(file, pattern);
93
+ if (pattern === void 0) {
94
+ return function() {
95
+ return fallbackValue;
61
96
  };
97
+ }
98
+ return function(file) {
99
+ return isMatch(file, pattern);
100
+ };
62
101
  }
63
102
  function getCacheDir(basedir = process.cwd()) {
64
- return path.resolve(basedir, 'node_modules/.cache', pluginName);
103
+ return path.resolve(basedir, "node_modules/.cache", pluginName);
65
104
  }
66
105
  function mkCacheDirectory(cwd = process.cwd()) {
67
- const cacheDirectory = getCacheDir(cwd);
68
- const exists = fs.existsSync(cacheDirectory);
69
- if (!exists) {
70
- fs.mkdirSync(cacheDirectory, {
71
- recursive: true
72
- });
73
- }
74
- return cacheDirectory;
106
+ const cacheDirectory = getCacheDir(cwd);
107
+ const exists = fs.existsSync(cacheDirectory);
108
+ if (!exists) {
109
+ fs.mkdirSync(cacheDirectory, {
110
+ recursive: true
111
+ });
112
+ }
113
+ return cacheDirectory;
75
114
  }
76
115
  function cacheDump(filename, data, basedir) {
77
- try {
78
- const dir = mkCacheDirectory(basedir);
79
- fs.writeFileSync(path.resolve(dir, filename), JSON.stringify([...data], undefined, 2), 'utf8');
80
- }
81
- catch (error) {
82
- console.log(error);
83
- }
116
+ try {
117
+ const dir = mkCacheDirectory(basedir);
118
+ fs.writeFileSync(path.resolve(dir, filename), JSON.stringify([...data], void 0, 2), "utf8");
119
+ } catch (error) {
120
+ console.log(error);
121
+ }
84
122
  }
85
123
 
86
- function getOptions(options = {}) {
87
- const includeMatcher = createGlobMatcher(options.include, true);
88
- const excludeMatcher = createGlobMatcher(options.exclude, false);
89
- const currentMangleClassFilter = options.mangleClassFilter ?? defaultMangleClassFilter;
90
- function isInclude(file) {
91
- return includeMatcher(file) && !excludeMatcher(file);
124
+ function getOptions(opts = {}) {
125
+ const {
126
+ include,
127
+ exclude,
128
+ disabled,
129
+ mangleClassFilter,
130
+ classMapOutput,
131
+ classGenerator: classGeneratorOptions,
132
+ classListPath: _classListPath
133
+ } = defu(opts, {
134
+ include: ["**/*.{js,jsx,ts,tsx,svelte,vue}"],
135
+ exclude: ["**/*.{css,scss,less,sass,postcss,html,htm}"],
136
+ disabled: process.env.NODE_ENV === "development"
137
+ });
138
+ const includeMatcher = createGlobMatcher(include, true);
139
+ const excludeMatcher = createGlobMatcher(exclude, false);
140
+ const currentMangleClassFilter = mangleClassFilter ?? defaultMangleClassFilter;
141
+ function isInclude(file) {
142
+ return includeMatcher(file) && !excludeMatcher(file);
143
+ }
144
+ const classSet = /* @__PURE__ */ new Set();
145
+ const replaceMap = /* @__PURE__ */ new Map();
146
+ let userConfig = getDefaultUserConfig();
147
+ const classMapOutputOptions = {
148
+ filename: "classMap.json"
149
+ };
150
+ if (typeof classMapOutput === "object") {
151
+ Object.assign(classMapOutputOptions, classMapOutput);
152
+ }
153
+ const classGenerator = new ClassGenerator(classGeneratorOptions);
154
+ function getCachedClassSet() {
155
+ return classSet;
156
+ }
157
+ function getReplaceMap() {
158
+ return replaceMap;
159
+ }
160
+ async function initConfig() {
161
+ const { config } = await getConfig();
162
+ userConfig = config;
163
+ let classListPath = "";
164
+ if (userConfig) {
165
+ classListPath = resolve(process.cwd(), userConfig.patch?.output?.filename);
92
166
  }
93
- let classSet;
94
- const twPatcher = new TailwindcssPatcher();
95
- const classSetOutputOptions = {
96
- filename: 'classSet.json',
97
- type: 'partial'
98
- };
99
- const classMapOutputOptions = {
100
- filename: 'classMap.json'
101
- };
102
- if (typeof options.classSetOutput === 'object') {
103
- Object.assign(classSetOutputOptions, options.classSetOutput);
167
+ if (_classListPath) {
168
+ classListPath = _classListPath;
104
169
  }
105
- if (typeof options.classMapOutput === 'object') {
106
- Object.assign(classMapOutputOptions, options.classMapOutput);
107
- }
108
- const classGenerator = new ClassGenerator(options.classGenerator);
109
- function getCachedClassSet() {
110
- const set = twPatcher.getClassSet();
111
- const isOutput = set.size > 0 && options.classSetOutput;
112
- if (isOutput && classSetOutputOptions.type === 'all') {
113
- cacheDump(classSetOutputOptions.filename, set, classSetOutputOptions.dir);
170
+ if (classListPath && fs.existsSync(classListPath)) {
171
+ const rawClassList = fs.readFileSync(classListPath, "utf8");
172
+ const list = JSON.parse(rawClassList);
173
+ const classList = sort(list).desc((c) => c.length);
174
+ for (const className of classList) {
175
+ if (currentMangleClassFilter(className)) {
176
+ classSet.add(className);
114
177
  }
115
- for (const c of set) {
116
- if (!currentMangleClassFilter(c)) {
117
- set.delete(c);
118
- }
119
- }
120
- if (isOutput && classSetOutputOptions.type === 'partial') {
121
- cacheDump(classSetOutputOptions.filename, set, classSetOutputOptions.dir);
122
- }
123
- classSet = set;
124
- return classSet;
178
+ }
125
179
  }
126
- return {
127
- getCachedClassSet,
128
- classGenerator,
129
- includeMatcher,
130
- excludeMatcher,
131
- isInclude,
132
- classSetOutputOptions,
133
- classMapOutputOptions,
134
- twPatcher,
135
- jsHandlerOptions: (options.jsHandlerOptions ?? {}),
136
- htmlHandlerOptions: (options.htmlHandlerOptions ?? {}),
137
- cssHandlerOptions: (options.cssHandlerOptions ?? {})
138
- };
180
+ for (const cls of classSet) {
181
+ classGenerator.generateClassName(cls);
182
+ }
183
+ for (const x of Object.entries(classGenerator.newClassMap)) {
184
+ replaceMap.set(x[0], x[1].name);
185
+ }
186
+ return config;
187
+ }
188
+ function addToUsedBy(key, file) {
189
+ const hit = classGenerator.newClassMap[key];
190
+ if (hit) {
191
+ hit.usedBy.add(file);
192
+ }
193
+ }
194
+ return {
195
+ getCachedClassSet,
196
+ classGenerator,
197
+ includeMatcher,
198
+ excludeMatcher,
199
+ isInclude,
200
+ classMapOutputOptions,
201
+ initConfig,
202
+ getReplaceMap,
203
+ addToUsedBy,
204
+ disabled,
205
+ htmlHandler,
206
+ cssHandler,
207
+ jsHandler,
208
+ preProcessJs
209
+ };
139
210
  }
140
211
 
141
- const outputCachedMap = new Map();
142
- const unplugin = createUnplugin((options = {}, meta) => {
143
- const { classGenerator, getCachedClassSet, isInclude, classMapOutputOptions, htmlHandlerOptions, jsHandlerOptions, cssHandlerOptions } = getOptions(options);
212
+ const unplugin = createUnplugin((options = {}) => {
213
+ const { isInclude, initConfig, getReplaceMap, classGenerator, addToUsedBy, classMapOutputOptions, disabled, htmlHandler, cssHandler, jsHandler, preProcessJs } = getOptions(options);
214
+ if (disabled) {
144
215
  return {
145
- name: pluginName,
146
- enforce: 'post',
147
- vite: {
148
- generateBundle: {
149
- handler(options, bundle, isWrite) {
150
- const runtimeSet = getCachedClassSet();
151
- if (runtimeSet.size === 0) {
152
- return;
153
- }
154
- const groupedEntries = getGroupedEntries(Object.entries(bundle));
155
- if (Array.isArray(groupedEntries.html) && groupedEntries.html.length > 0) {
156
- for (let i = 0; i < groupedEntries.html.length; i++) {
157
- const [file, asset] = groupedEntries.html[i];
158
- if (isInclude(file)) {
159
- asset.source = htmlHandler(asset.source.toString(), {
160
- ...htmlHandlerOptions,
161
- classGenerator,
162
- runtimeSet
163
- });
164
- }
165
- }
166
- }
167
- if (Array.isArray(groupedEntries.js) && groupedEntries.js.length > 0) {
168
- for (let i = 0; i < groupedEntries.js.length; i++) {
169
- const [file, chunk] = groupedEntries.js[i];
170
- if (isInclude(file)) {
171
- const code = jsHandler(chunk.code, {
172
- ...jsHandlerOptions,
173
- runtimeSet,
174
- classGenerator
175
- }).code;
176
- if (code) {
177
- chunk.code = code;
178
- }
179
- }
180
- }
181
- }
182
- if (Array.isArray(groupedEntries.css) && groupedEntries.css.length > 0) {
183
- for (let i = 0; i < groupedEntries.css.length; i++) {
184
- const [file, css] = groupedEntries.css[i];
185
- if (isInclude(file)) {
186
- css.source = cssHandler(css.source.toString(), {
187
- ...cssHandlerOptions,
188
- classGenerator,
189
- runtimeSet
190
- });
191
- }
192
- }
193
- }
194
- }
195
- }
196
- },
197
- webpack(compiler) {
198
- const { NormalModule, Compilation } = compiler.webpack;
199
- const { ConcatSource } = compiler.webpack.sources;
200
- function getAssetPath(outputPath, file, abs = true) {
201
- const fn = abs ? path.resolve : path.relative;
202
- return fn(compiler.context, path.resolve(outputPath, file));
216
+ name: pluginName
217
+ };
218
+ }
219
+ return {
220
+ name: pluginName,
221
+ enforce: "pre",
222
+ async buildStart() {
223
+ await initConfig();
224
+ },
225
+ transformInclude(id) {
226
+ return isInclude(id);
227
+ },
228
+ transform(code, id) {
229
+ const replaceMap = getReplaceMap();
230
+ if (id.endsWith(".js") || id.endsWith(".ts") || id.endsWith(".tsx") || id.endsWith(".jsx")) {
231
+ const str = preProcessJs({
232
+ code,
233
+ replaceMap,
234
+ addToUsedBy,
235
+ id
236
+ });
237
+ return str;
238
+ } else {
239
+ for (const [key, value] of replaceMap) {
240
+ code = code.replaceAll(key, value);
241
+ }
242
+ }
243
+ return code;
244
+ },
245
+ vite: {
246
+ generateBundle: {
247
+ async handler(options2, bundle) {
248
+ const replaceMap = getReplaceMap();
249
+ const groupedEntries = getGroupedEntries(Object.entries(bundle));
250
+ if (Array.isArray(groupedEntries.css) && groupedEntries.css.length > 0) {
251
+ for (let i = 0; i < groupedEntries.css.length; i++) {
252
+ const [file, cssSource] = groupedEntries.css[i];
253
+ const { css } = await cssHandler(cssSource.source.toString(), {
254
+ file,
255
+ replaceMap,
256
+ classGenerator
257
+ });
258
+ cssSource.source = css;
203
259
  }
204
- function overwriteServerSideAsset(outputPath, file, data) {
205
- const abs = getAssetPath(outputPath, file);
206
- const rel = getAssetPath(outputPath, file, false);
207
- try {
208
- fs.writeFileSync(abs, data, 'utf8');
209
- console.log('[tailwindcss-mangle]: ' + rel + ' overwrited successfully');
210
- }
211
- catch (error) {
212
- console.log('[tailwindcss-mangle]: ' + rel + ' overwrited fail!');
213
- console.log(error);
260
+ }
261
+ }
262
+ }
263
+ },
264
+ webpack(compiler) {
265
+ const { Compilation, sources } = compiler.webpack;
266
+ const { ConcatSource } = sources;
267
+ compiler.hooks.compilation.tap(pluginName, (compilation) => {
268
+ compilation.hooks.processAssets.tapPromise(
269
+ {
270
+ name: pluginName,
271
+ stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
272
+ },
273
+ async (assets) => {
274
+ const replaceMap = getReplaceMap();
275
+ const groupedEntries = getGroupedEntries(Object.entries(assets));
276
+ if (groupedEntries.js.length > 0) {
277
+ for (let i = 0; i < groupedEntries.js.length; i++) {
278
+ const [file, chunk] = groupedEntries.js[i];
279
+ const code = jsHandler(chunk.source().toString(), {
280
+ replaceMap,
281
+ classGenerator
282
+ }).code;
283
+ if (code) {
284
+ const source = new ConcatSource(code);
285
+ compilation.updateAsset(file, source);
214
286
  }
287
+ }
215
288
  }
216
- const twmCssloader = path.resolve(__dirname, 'twm-css.js');
217
- compiler.hooks.compilation.tap(pluginName, (compilation) => {
218
- NormalModule.getCompilationHooks(compilation).loader.tap(pluginName, (loaderContext, module) => {
219
- const idx = module.loaders.findIndex((x) => x.loader.includes('css-loader'));
220
- if (idx > -1) {
221
- module.loaders.splice(idx + 1, 0, {
222
- loader: twmCssloader,
223
- options: {
224
- classGenerator,
225
- getCachedClassSet
226
- },
227
- ident: null,
228
- type: null
229
- });
230
- }
289
+ if (groupedEntries.css.length > 0) {
290
+ for (let i = 0; i < groupedEntries.css.length; i++) {
291
+ const [file, cssSource] = groupedEntries.css[i];
292
+ const { css } = await cssHandler(cssSource.source().toString(), {
293
+ replaceMap,
294
+ file,
295
+ classGenerator
231
296
  });
232
- compilation.hooks.processAssets.tap({
233
- name: pluginName,
234
- stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
235
- }, (assets) => {
236
- const runtimeSet = getCachedClassSet();
237
- const groupedEntries = getGroupedEntries(Object.entries(assets));
238
- if (runtimeSet.size === 0) {
239
- const css = new Map();
240
- const html = new Map();
241
- const js = new Map();
242
- for (const [file, source] of groupedEntries.css) {
243
- css.set(file, source);
244
- }
245
- for (const [file, source] of groupedEntries.html) {
246
- html.set(file, source);
247
- }
248
- for (const [file, source] of groupedEntries.js) {
249
- js.set(file, source);
250
- }
251
- if (js.size > 0 || css.size > 0 || html.size > 0) {
252
- outputCachedMap.set(compiler.outputPath, {
253
- css,
254
- html,
255
- js
256
- });
257
- }
258
- return;
259
- }
260
- if (groupedEntries.html.length > 0) {
261
- for (let i = 0; i < groupedEntries.html.length; i++) {
262
- const [file, asset] = groupedEntries.html[i];
263
- if (isInclude(file)) {
264
- const html = htmlHandler(asset.source().toString(), {
265
- ...htmlHandlerOptions,
266
- classGenerator,
267
- runtimeSet
268
- });
269
- const source = new ConcatSource(html);
270
- compilation.updateAsset(file, source);
271
- }
272
- }
273
- }
274
- if (groupedEntries.js.length > 0) {
275
- for (let i = 0; i < groupedEntries.js.length; i++) {
276
- const [file, chunk] = groupedEntries.js[i];
277
- if (isInclude(file)) {
278
- const code = jsHandler(chunk.source().toString(), {
279
- ...jsHandlerOptions,
280
- runtimeSet,
281
- classGenerator
282
- }).code;
283
- if (code) {
284
- const source = new ConcatSource(code);
285
- compilation.updateAsset(file, source);
286
- }
287
- }
288
- }
289
- }
290
- if (groupedEntries.css.length > 0) {
291
- for (let i = 0; i < groupedEntries.css.length; i++) {
292
- const [file, css] = groupedEntries.css[i];
293
- if (isInclude(file)) {
294
- const newCss = cssHandler(css.source().toString(), {
295
- ...cssHandlerOptions,
296
- classGenerator,
297
- runtimeSet
298
- });
299
- const source = new ConcatSource(newCss);
300
- compilation.updateAsset(file, source);
301
- }
302
- }
303
- }
304
- for (const [key, { js, html, css }] of outputCachedMap.entries()) {
305
- if (html.size > 0) {
306
- for (const [file, asset] of html.entries()) {
307
- if (isInclude(file)) {
308
- const html = htmlHandler(asset.source().toString(), {
309
- ...htmlHandlerOptions,
310
- classGenerator,
311
- runtimeSet
312
- });
313
- overwriteServerSideAsset(key, file, html);
314
- }
315
- }
316
- html.clear();
317
- }
318
- if (js.size > 0) {
319
- for (const [file, chunk] of js.entries()) {
320
- if (isInclude(file)) {
321
- const rawCode = chunk.source().toString();
322
- const code = jsHandler(rawCode, {
323
- ...jsHandlerOptions,
324
- runtimeSet,
325
- classGenerator
326
- }).code;
327
- if (code) {
328
- overwriteServerSideAsset(key, file, code);
329
- }
330
- }
331
- }
332
- js.clear();
333
- }
334
- if (css.size > 0) {
335
- for (const [file, style] of css.entries()) {
336
- if (isInclude(file)) {
337
- const newCss = cssHandler(style.source().toString(), {
338
- ...cssHandlerOptions,
339
- classGenerator,
340
- runtimeSet
341
- });
342
- overwriteServerSideAsset(key, file, newCss);
343
- }
344
- }
345
- css.clear();
346
- }
347
- }
297
+ const source = new ConcatSource(css);
298
+ compilation.updateAsset(file, source);
299
+ }
300
+ }
301
+ if (groupedEntries.html.length > 0) {
302
+ for (let i = 0; i < groupedEntries.html.length; i++) {
303
+ const [file, asset] = groupedEntries.html[i];
304
+ const html = htmlHandler(asset.source().toString(), {
305
+ classGenerator,
306
+ replaceMap
348
307
  });
349
- });
350
- },
351
- writeBundle() {
352
- const entries = Object.entries(classGenerator.newClassMap);
353
- if (entries.length > 0 && classMapOutputOptions) {
354
- cacheDump(classMapOutputOptions.filename, entries.map((x) => {
355
- return [x[0], x[1].name];
356
- }), classMapOutputOptions.dir);
308
+ const source = new ConcatSource(html);
309
+ compilation.updateAsset(file, source);
310
+ }
357
311
  }
358
- }
359
- };
312
+ }
313
+ );
314
+ });
315
+ },
316
+ writeBundle() {
317
+ const entries = Object.entries(classGenerator.newClassMap);
318
+ if (entries.length > 0 && classMapOutputOptions) {
319
+ cacheDump(
320
+ classMapOutputOptions.filename,
321
+ entries.map((x) => {
322
+ return {
323
+ origin: x[0],
324
+ replacement: x[1].name,
325
+ usedBy: [...x[1].usedBy]
326
+ };
327
+ }),
328
+ classMapOutputOptions.dir
329
+ );
330
+ }
331
+ }
332
+ };
360
333
  });
361
- const vitePlugin = unplugin.vite;
362
- const webpackPlugin = unplugin.webpack;
363
334
 
364
- export { unplugin, vitePlugin, webpackPlugin };
335
+ export { unplugin as default };