@animus-ui/unplugin 0.1.22 → 0.1.24
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/{core-CA2hGS8D.cjs → core-BqEruPuj.cjs} +131 -14
- package/dist/{core-BefIaJxu.mjs → core-CP2SnWlP.mjs} +132 -15
- package/dist/core.d.ts.map +1 -1
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.d.ts +1 -1
- package/dist/esbuild.d.ts.map +1 -1
- package/dist/esbuild.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/options.d.ts +11 -1
- package/dist/options.d.ts.map +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.d.ts.map +1 -1
- package/dist/rollup.mjs +1 -1
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/rspack.d.ts.map +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.d.ts.map +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +2 -2
|
@@ -20,11 +20,14 @@ function hasRequiredSystem(options) {
|
|
|
20
20
|
function resolveHostOptions(raw, cwd = process.cwd()) {
|
|
21
21
|
const options = raw ?? {};
|
|
22
22
|
(0, _animus_ui_extract_pipeline.assertNoRetiredEngineSelection)(options.engine);
|
|
23
|
-
(0, _animus_ui_extract_pipeline.assertKnownOptionKeys)(options);
|
|
23
|
+
(0, _animus_ui_extract_pipeline.assertKnownOptionKeys)(options, ["watch"]);
|
|
24
24
|
if (!hasRequiredSystem(options)) throw new _animus_ui_extract_pipeline.AnimusConfigError("Missing required option `system` — pass `system: \"./src/ds.ts\"` to the Animus plugin.");
|
|
25
|
+
const root = options.root ? (0, node_path.resolve)(cwd, options.root) : cwd;
|
|
26
|
+
const { watch, ...core } = options;
|
|
25
27
|
return {
|
|
26
|
-
root
|
|
27
|
-
options
|
|
28
|
+
root,
|
|
29
|
+
options: core,
|
|
30
|
+
watch: watch === true
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
33
|
function resolveHostMode(explicit, oracle) {
|
|
@@ -98,17 +101,42 @@ function transformWithEngine(code, id, ctx) {
|
|
|
98
101
|
const result = ctx.transformFile(code, filename, ctx.manifestJson);
|
|
99
102
|
return result.hasComponents ? result.code : null;
|
|
100
103
|
}
|
|
104
|
+
/** Whether esbuild's `external` option names `specifier`: exactly, as the
|
|
105
|
+
* package a subpath belongs to, or through a `*` wildcard. */
|
|
106
|
+
function isEsbuildExternal(specifier, external) {
|
|
107
|
+
return (external ?? []).some((pattern) => {
|
|
108
|
+
if (!pattern.includes("*")) return specifier === pattern || specifier.startsWith(`${pattern}/`);
|
|
109
|
+
const [prefix, suffix] = pattern.split("*", 2);
|
|
110
|
+
return specifier.length >= prefix.length + suffix.length && specifier.startsWith(prefix) && specifier.endsWith(suffix);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
101
113
|
function moduleFilePath(id) {
|
|
102
114
|
const query = id.indexOf("?");
|
|
103
115
|
return query === -1 ? id : id.slice(0, query);
|
|
104
116
|
}
|
|
117
|
+
/** Whether a hook context is a Rollup-family one that resolves imports. */
|
|
118
|
+
function canResolve(context) {
|
|
119
|
+
return "resolve" in context;
|
|
120
|
+
}
|
|
121
|
+
/** Marks the esbuild resolve that `esbuild.setup` makes for itself. */
|
|
122
|
+
const KIT_SOURCE_RESOLVE = "animus:kit-source-resolve";
|
|
105
123
|
const PLUGIN_NAME = "animus-host";
|
|
124
|
+
const ESBUILD_WATCH_HINT = "If this is an esbuild watch or serve context, pass watch: true to the Animus esbuild plugin.";
|
|
106
125
|
const unpluginFactory = (rawOptions, meta) => {
|
|
107
|
-
const { root, options } = resolveHostOptions(rawOptions);
|
|
126
|
+
const { root, options, watch } = resolveHostOptions(rawOptions);
|
|
108
127
|
const state = createHostState();
|
|
109
128
|
let activeSession = null;
|
|
110
129
|
let modeOracle = null;
|
|
130
|
+
/** Whether the host is watching, where an error-level diagnostic reports
|
|
131
|
+
* and the pipeline still publishes. Only a build fails on one. Rollup's
|
|
132
|
+
* oracle is its watch mode; webpack's is its `mode`, so it reads
|
|
133
|
+
* `watchMode` instead, and Vite reads its command. esbuild gives neither,
|
|
134
|
+
* so its author says so with the `watch` option. */
|
|
135
|
+
let watching = () => modeOracle === "development";
|
|
111
136
|
let esbuildOptions = null;
|
|
137
|
+
/** The bundler's export conditions, in its order, for the system loader;
|
|
138
|
+
* Rollup exposes none. */
|
|
139
|
+
let hostConditions = [];
|
|
112
140
|
/** Hooks can fire before buildStart (webpack's make taps run
|
|
113
141
|
* concurrently), so joiners await this before awaiting the pipeline. */
|
|
114
142
|
let signalPipelineStarted;
|
|
@@ -116,6 +144,8 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
116
144
|
signalPipelineStarted = res;
|
|
117
145
|
});
|
|
118
146
|
const effectiveMode = () => resolveHostMode(options.mode, modeOracle);
|
|
147
|
+
/** Hosts whose `resolveId` result carries `moduleSideEffects`. */
|
|
148
|
+
const rollupLike = meta.framework === "rollup" || meta.framework === "rolldown" || meta.framework === "vite";
|
|
119
149
|
const needsInlineDefine = meta.framework !== "esbuild" && meta.framework !== "webpack" && meta.framework !== "rspack";
|
|
120
150
|
const unbundledComputedImports = meta.framework === "rollup" || meta.framework === "rolldown" || meta.framework === "esbuild" || meta.framework === "vite";
|
|
121
151
|
async function startPipeline() {
|
|
@@ -124,6 +154,7 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
124
154
|
await runClaimedPipeline();
|
|
125
155
|
} catch (error) {
|
|
126
156
|
releaseClaim();
|
|
157
|
+
if (meta.framework === "esbuild" && !watch && error instanceof _animus_ui_extract_pipeline.DiagnosticFailure) throw new Error(`${String(error)}\n${ESBUILD_WATCH_HINT}`, { cause: error });
|
|
127
158
|
throw error;
|
|
128
159
|
}
|
|
129
160
|
}
|
|
@@ -140,8 +171,10 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
140
171
|
mode
|
|
141
172
|
}, { unbundledComputedImports });
|
|
142
173
|
activeSession = session;
|
|
174
|
+
session.development = watching();
|
|
143
175
|
session.driverLabel = "animus-unplugin";
|
|
144
176
|
session.rootDir = root;
|
|
177
|
+
session.conditions = hostConditions;
|
|
145
178
|
session.systemPropsModuleId = _animus_ui_extract_session.TURBOPACK_SYSTEM_PROPS_ID;
|
|
146
179
|
const aliasPairs = (0, _animus_ui_extract_pipeline.readTsconfigAliasPairs)(root);
|
|
147
180
|
const builtAliases = (0, _animus_ui_extract_pipeline.buildPathAliasesJson)(aliasPairs, root);
|
|
@@ -218,10 +251,21 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
218
251
|
await startPipeline();
|
|
219
252
|
registerWatchTargets(this);
|
|
220
253
|
},
|
|
221
|
-
async resolveId(id) {
|
|
254
|
+
async resolveId(id, importer) {
|
|
222
255
|
const virtual = resolveAnimusId(id);
|
|
223
256
|
if (virtual !== null) return virtual;
|
|
257
|
+
if (id.startsWith(".") && importer !== void 0 && rollupLike) await joinPipeline();
|
|
258
|
+
if (id.startsWith(".") && importer !== void 0 && rollupLike && state.externalPackageDirs.some((dir) => (0, _animus_ui_extract_pipeline.isPathWithinRoot)(dir, moduleFilePath(importer)))) {
|
|
259
|
+
if (!canResolve(this)) return null;
|
|
260
|
+
const resolved = await this.resolve(id, importer, { skipSelf: true });
|
|
261
|
+
if (resolved === null || resolved.external || !(0, _animus_ui_extract_pipeline.keepsKitSourceEffects)(moduleFilePath(resolved.id), state.externalPackageDirs)) return null;
|
|
262
|
+
return {
|
|
263
|
+
id: resolved.id,
|
|
264
|
+
moduleSideEffects: true
|
|
265
|
+
};
|
|
266
|
+
}
|
|
224
267
|
if (id.startsWith(".") || id.startsWith("/") || id.startsWith("\0") || id.startsWith("animus:")) return null;
|
|
268
|
+
if (meta.framework === "esbuild") return null;
|
|
225
269
|
await joinPipeline();
|
|
226
270
|
const target = state.kitRedirects.get(id);
|
|
227
271
|
if (target === void 0) return null;
|
|
@@ -291,6 +335,10 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
291
335
|
releaseClaim();
|
|
292
336
|
}
|
|
293
337
|
},
|
|
338
|
+
vite: { configResolved(config) {
|
|
339
|
+
const serving = config.command === "serve" || Boolean(config.build.watch);
|
|
340
|
+
watching = () => serving;
|
|
341
|
+
} },
|
|
294
342
|
rollup: { async buildStart() {
|
|
295
343
|
modeOracle = this.meta?.watchMode ? "development" : "production";
|
|
296
344
|
await startPipeline();
|
|
@@ -307,15 +355,81 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
307
355
|
},
|
|
308
356
|
rspack(compiler) {
|
|
309
357
|
wireWebpackLike(compiler);
|
|
358
|
+
classifyRspackRedirects(compiler);
|
|
310
359
|
},
|
|
311
|
-
esbuild: {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
360
|
+
esbuild: {
|
|
361
|
+
/** unplugin's esbuild resolve drops `moduleSideEffects` and puts the
|
|
362
|
+
* target in its own namespace, where no package classifies it. A
|
|
363
|
+
* redirect resolved here stays in the `file` namespace and carries the
|
|
364
|
+
* replaced entry's classification. */
|
|
365
|
+
setup(build) {
|
|
366
|
+
build.onResolve({ filter: /^\./ }, async (args) => {
|
|
367
|
+
if (args.pluginData === KIT_SOURCE_RESOLVE) return void 0;
|
|
368
|
+
await joinPipeline();
|
|
369
|
+
if (!state.externalPackageDirs.some((dir) => (0, _animus_ui_extract_pipeline.isPathWithinRoot)(dir, args.importer))) return;
|
|
370
|
+
const resolved = await build.resolve(args.path, {
|
|
371
|
+
importer: args.importer,
|
|
372
|
+
resolveDir: args.resolveDir,
|
|
373
|
+
kind: args.kind,
|
|
374
|
+
pluginData: KIT_SOURCE_RESOLVE
|
|
375
|
+
});
|
|
376
|
+
if (resolved.errors.length > 0 || resolved.external || !(0, _animus_ui_extract_pipeline.keepsKitSourceEffects)(resolved.path, state.externalPackageDirs)) return;
|
|
377
|
+
return {
|
|
378
|
+
path: resolved.path,
|
|
379
|
+
namespace: resolved.namespace,
|
|
380
|
+
suffix: resolved.suffix,
|
|
381
|
+
sideEffects: true
|
|
382
|
+
};
|
|
383
|
+
});
|
|
384
|
+
build.onResolve({ filter: /^[^./\0]/ }, async (args) => {
|
|
385
|
+
if (args.path.startsWith("animus:")) return void 0;
|
|
386
|
+
if (isEsbuildExternal(args.path, build.initialOptions.external)) return;
|
|
387
|
+
await joinPipeline();
|
|
388
|
+
const target = state.kitRedirects.get(args.path);
|
|
389
|
+
if (target === void 0) return void 0;
|
|
390
|
+
const sideEffects = state.kitSideEffects.get(args.path);
|
|
391
|
+
return sideEffects === void 0 ? { path: target } : {
|
|
392
|
+
path: target,
|
|
393
|
+
sideEffects
|
|
394
|
+
};
|
|
395
|
+
});
|
|
396
|
+
},
|
|
397
|
+
config(buildOptions) {
|
|
398
|
+
esbuildOptions = buildOptions;
|
|
399
|
+
hostConditions = buildOptions.conditions ?? [];
|
|
400
|
+
watching = () => watch;
|
|
401
|
+
buildOptions.define = {
|
|
402
|
+
...buildOptions.define,
|
|
403
|
+
__ANIMUS_DEV__: JSON.stringify(effectiveMode() === "development")
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
}
|
|
318
407
|
};
|
|
408
|
+
/** Rspack's resolve data carries no rule settings, so a module rule per
|
|
409
|
+
* classification marks each redirect target, read when it resolves. */
|
|
410
|
+
function classifyRspackRedirects(compiler) {
|
|
411
|
+
const classification = (resource) => {
|
|
412
|
+
let pure = false;
|
|
413
|
+
for (const [specifier, target] of state.kitRedirects) {
|
|
414
|
+
if (target !== resource) continue;
|
|
415
|
+
const sideEffects = state.kitSideEffects.get(specifier);
|
|
416
|
+
if (sideEffects === true) return true;
|
|
417
|
+
if (sideEffects === false) pure = true;
|
|
418
|
+
}
|
|
419
|
+
return pure ? false : void 0;
|
|
420
|
+
};
|
|
421
|
+
compiler.options.module.rules.push({
|
|
422
|
+
test: (resource) => classification(resource) === true,
|
|
423
|
+
sideEffects: true
|
|
424
|
+
}, {
|
|
425
|
+
test: (resource) => classification(resource) === false,
|
|
426
|
+
sideEffects: false
|
|
427
|
+
}, {
|
|
428
|
+
test: (resource) => (0, _animus_ui_extract_pipeline.keepsKitSourceEffects)(resource, state.externalPackageDirs),
|
|
429
|
+
issuer: (issuer) => state.externalPackageDirs.some((dir) => (0, _animus_ui_extract_pipeline.isPathWithinRoot)(dir, issuer)),
|
|
430
|
+
sideEffects: true
|
|
431
|
+
});
|
|
432
|
+
}
|
|
319
433
|
/** Webpack would classify a redirect target by its own path against the
|
|
320
434
|
* package's `sideEffects`, so the replaced entry's classification is set
|
|
321
435
|
* as a rule's would be. Rspack's resolve data is not known to carry
|
|
@@ -324,14 +438,17 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
324
438
|
compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, (nmf) => {
|
|
325
439
|
nmf.hooks.afterResolve.tap(PLUGIN_NAME, (resolveData) => {
|
|
326
440
|
const { createData } = resolveData;
|
|
441
|
+
if (!createData?.settings || createData.resource === void 0) return;
|
|
327
442
|
const sideEffects = state.kitSideEffects.get(resolveData.request);
|
|
328
|
-
if (sideEffects
|
|
329
|
-
createData.settings.sideEffects =
|
|
443
|
+
if (sideEffects !== void 0 && createData.resource === state.kitRedirects.get(resolveData.request)) createData.settings.sideEffects = sideEffects;
|
|
444
|
+
else if ((0, _animus_ui_extract_pipeline.keepsKitSourceEffects)(moduleFilePath(createData.resource), state.externalPackageDirs)) createData.settings.sideEffects = true;
|
|
330
445
|
});
|
|
331
446
|
});
|
|
332
447
|
}
|
|
333
448
|
function wireWebpackLike(compiler) {
|
|
334
449
|
modeOracle = compiler.options.mode === "development" ? "development" : "production";
|
|
450
|
+
hostConditions = (compiler.options.resolve?.conditionNames ?? []).filter((name) => name !== "...");
|
|
451
|
+
watching = () => compiler.watchMode === true;
|
|
335
452
|
const DefinePlugin = compiler.webpack?.DefinePlugin ?? compiler.rspack?.DefinePlugin;
|
|
336
453
|
if (!DefinePlugin) throw new Error("[animus] compiler exposes no DefinePlugin — cannot supply the __ANIMUS_DEV__ dev-signal define");
|
|
337
454
|
new DefinePlugin({ __ANIMUS_DEV__: JSON.stringify(effectiveMode() === "development") }).apply(compiler);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimusConfigError, ENGINE_TRANSFORM_EXTENSIONS, assertKnownOptionKeys, assertNoRetiredEngineSelection, buildPathAliasesJson, isEngineTransformExtension, isPathWithinRoot, readTsconfigAliasPairs, resolveMode } from "@animus-ui/extract/pipeline";
|
|
1
|
+
import { AnimusConfigError, DiagnosticFailure, ENGINE_TRANSFORM_EXTENSIONS, assertKnownOptionKeys, assertNoRetiredEngineSelection, buildPathAliasesJson, isEngineTransformExtension, isPathWithinRoot, keepsKitSourceEffects, readTsconfigAliasPairs, resolveMode } from "@animus-ui/extract/pipeline";
|
|
2
2
|
import { ANIMUS_CSS_MODULE_ID, ExtractionSession, SESSION_ASSETS_DIR, TURBOPACK_SYSTEM_PROPS_ID, collectSessionAssets, engineApi, getAnalyzedHashes, getManifestJson, getSessionArtifactDir, getSharedCss, getSharedSystemProps } from "@animus-ui/extract/session";
|
|
3
3
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { dirname, join, relative, resolve } from "node:path";
|
|
@@ -20,11 +20,14 @@ function hasRequiredSystem(options) {
|
|
|
20
20
|
function resolveHostOptions(raw, cwd = process.cwd()) {
|
|
21
21
|
const options = raw ?? {};
|
|
22
22
|
assertNoRetiredEngineSelection(options.engine);
|
|
23
|
-
assertKnownOptionKeys(options);
|
|
23
|
+
assertKnownOptionKeys(options, ["watch"]);
|
|
24
24
|
if (!hasRequiredSystem(options)) throw new AnimusConfigError("Missing required option `system` — pass `system: \"./src/ds.ts\"` to the Animus plugin.");
|
|
25
|
+
const root = options.root ? resolve(cwd, options.root) : cwd;
|
|
26
|
+
const { watch, ...core } = options;
|
|
25
27
|
return {
|
|
26
|
-
root
|
|
27
|
-
options
|
|
28
|
+
root,
|
|
29
|
+
options: core,
|
|
30
|
+
watch: watch === true
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
33
|
function resolveHostMode(explicit, oracle) {
|
|
@@ -98,17 +101,42 @@ function transformWithEngine(code, id, ctx) {
|
|
|
98
101
|
const result = ctx.transformFile(code, filename, ctx.manifestJson);
|
|
99
102
|
return result.hasComponents ? result.code : null;
|
|
100
103
|
}
|
|
104
|
+
/** Whether esbuild's `external` option names `specifier`: exactly, as the
|
|
105
|
+
* package a subpath belongs to, or through a `*` wildcard. */
|
|
106
|
+
function isEsbuildExternal(specifier, external) {
|
|
107
|
+
return (external ?? []).some((pattern) => {
|
|
108
|
+
if (!pattern.includes("*")) return specifier === pattern || specifier.startsWith(`${pattern}/`);
|
|
109
|
+
const [prefix, suffix] = pattern.split("*", 2);
|
|
110
|
+
return specifier.length >= prefix.length + suffix.length && specifier.startsWith(prefix) && specifier.endsWith(suffix);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
101
113
|
function moduleFilePath(id) {
|
|
102
114
|
const query = id.indexOf("?");
|
|
103
115
|
return query === -1 ? id : id.slice(0, query);
|
|
104
116
|
}
|
|
117
|
+
/** Whether a hook context is a Rollup-family one that resolves imports. */
|
|
118
|
+
function canResolve(context) {
|
|
119
|
+
return "resolve" in context;
|
|
120
|
+
}
|
|
121
|
+
/** Marks the esbuild resolve that `esbuild.setup` makes for itself. */
|
|
122
|
+
const KIT_SOURCE_RESOLVE = "animus:kit-source-resolve";
|
|
105
123
|
const PLUGIN_NAME = "animus-host";
|
|
124
|
+
const ESBUILD_WATCH_HINT = "If this is an esbuild watch or serve context, pass watch: true to the Animus esbuild plugin.";
|
|
106
125
|
const unpluginFactory = (rawOptions, meta) => {
|
|
107
|
-
const { root, options } = resolveHostOptions(rawOptions);
|
|
126
|
+
const { root, options, watch } = resolveHostOptions(rawOptions);
|
|
108
127
|
const state = createHostState();
|
|
109
128
|
let activeSession = null;
|
|
110
129
|
let modeOracle = null;
|
|
130
|
+
/** Whether the host is watching, where an error-level diagnostic reports
|
|
131
|
+
* and the pipeline still publishes. Only a build fails on one. Rollup's
|
|
132
|
+
* oracle is its watch mode; webpack's is its `mode`, so it reads
|
|
133
|
+
* `watchMode` instead, and Vite reads its command. esbuild gives neither,
|
|
134
|
+
* so its author says so with the `watch` option. */
|
|
135
|
+
let watching = () => modeOracle === "development";
|
|
111
136
|
let esbuildOptions = null;
|
|
137
|
+
/** The bundler's export conditions, in its order, for the system loader;
|
|
138
|
+
* Rollup exposes none. */
|
|
139
|
+
let hostConditions = [];
|
|
112
140
|
/** Hooks can fire before buildStart (webpack's make taps run
|
|
113
141
|
* concurrently), so joiners await this before awaiting the pipeline. */
|
|
114
142
|
let signalPipelineStarted;
|
|
@@ -116,6 +144,8 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
116
144
|
signalPipelineStarted = res;
|
|
117
145
|
});
|
|
118
146
|
const effectiveMode = () => resolveHostMode(options.mode, modeOracle);
|
|
147
|
+
/** Hosts whose `resolveId` result carries `moduleSideEffects`. */
|
|
148
|
+
const rollupLike = meta.framework === "rollup" || meta.framework === "rolldown" || meta.framework === "vite";
|
|
119
149
|
const needsInlineDefine = meta.framework !== "esbuild" && meta.framework !== "webpack" && meta.framework !== "rspack";
|
|
120
150
|
const unbundledComputedImports = meta.framework === "rollup" || meta.framework === "rolldown" || meta.framework === "esbuild" || meta.framework === "vite";
|
|
121
151
|
async function startPipeline() {
|
|
@@ -124,6 +154,7 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
124
154
|
await runClaimedPipeline();
|
|
125
155
|
} catch (error) {
|
|
126
156
|
releaseClaim();
|
|
157
|
+
if (meta.framework === "esbuild" && !watch && error instanceof DiagnosticFailure) throw new Error(`${String(error)}\n${ESBUILD_WATCH_HINT}`, { cause: error });
|
|
127
158
|
throw error;
|
|
128
159
|
}
|
|
129
160
|
}
|
|
@@ -140,8 +171,10 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
140
171
|
mode
|
|
141
172
|
}, { unbundledComputedImports });
|
|
142
173
|
activeSession = session;
|
|
174
|
+
session.development = watching();
|
|
143
175
|
session.driverLabel = "animus-unplugin";
|
|
144
176
|
session.rootDir = root;
|
|
177
|
+
session.conditions = hostConditions;
|
|
145
178
|
session.systemPropsModuleId = TURBOPACK_SYSTEM_PROPS_ID;
|
|
146
179
|
const aliasPairs = readTsconfigAliasPairs(root);
|
|
147
180
|
const builtAliases = buildPathAliasesJson(aliasPairs, root);
|
|
@@ -218,10 +251,21 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
218
251
|
await startPipeline();
|
|
219
252
|
registerWatchTargets(this);
|
|
220
253
|
},
|
|
221
|
-
async resolveId(id) {
|
|
254
|
+
async resolveId(id, importer) {
|
|
222
255
|
const virtual = resolveAnimusId(id);
|
|
223
256
|
if (virtual !== null) return virtual;
|
|
257
|
+
if (id.startsWith(".") && importer !== void 0 && rollupLike) await joinPipeline();
|
|
258
|
+
if (id.startsWith(".") && importer !== void 0 && rollupLike && state.externalPackageDirs.some((dir) => isPathWithinRoot(dir, moduleFilePath(importer)))) {
|
|
259
|
+
if (!canResolve(this)) return null;
|
|
260
|
+
const resolved = await this.resolve(id, importer, { skipSelf: true });
|
|
261
|
+
if (resolved === null || resolved.external || !keepsKitSourceEffects(moduleFilePath(resolved.id), state.externalPackageDirs)) return null;
|
|
262
|
+
return {
|
|
263
|
+
id: resolved.id,
|
|
264
|
+
moduleSideEffects: true
|
|
265
|
+
};
|
|
266
|
+
}
|
|
224
267
|
if (id.startsWith(".") || id.startsWith("/") || id.startsWith("\0") || id.startsWith("animus:")) return null;
|
|
268
|
+
if (meta.framework === "esbuild") return null;
|
|
225
269
|
await joinPipeline();
|
|
226
270
|
const target = state.kitRedirects.get(id);
|
|
227
271
|
if (target === void 0) return null;
|
|
@@ -291,6 +335,10 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
291
335
|
releaseClaim();
|
|
292
336
|
}
|
|
293
337
|
},
|
|
338
|
+
vite: { configResolved(config) {
|
|
339
|
+
const serving = config.command === "serve" || Boolean(config.build.watch);
|
|
340
|
+
watching = () => serving;
|
|
341
|
+
} },
|
|
294
342
|
rollup: { async buildStart() {
|
|
295
343
|
modeOracle = this.meta?.watchMode ? "development" : "production";
|
|
296
344
|
await startPipeline();
|
|
@@ -307,15 +355,81 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
307
355
|
},
|
|
308
356
|
rspack(compiler) {
|
|
309
357
|
wireWebpackLike(compiler);
|
|
358
|
+
classifyRspackRedirects(compiler);
|
|
310
359
|
},
|
|
311
|
-
esbuild: {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
360
|
+
esbuild: {
|
|
361
|
+
/** unplugin's esbuild resolve drops `moduleSideEffects` and puts the
|
|
362
|
+
* target in its own namespace, where no package classifies it. A
|
|
363
|
+
* redirect resolved here stays in the `file` namespace and carries the
|
|
364
|
+
* replaced entry's classification. */
|
|
365
|
+
setup(build) {
|
|
366
|
+
build.onResolve({ filter: /^\./ }, async (args) => {
|
|
367
|
+
if (args.pluginData === KIT_SOURCE_RESOLVE) return void 0;
|
|
368
|
+
await joinPipeline();
|
|
369
|
+
if (!state.externalPackageDirs.some((dir) => isPathWithinRoot(dir, args.importer))) return;
|
|
370
|
+
const resolved = await build.resolve(args.path, {
|
|
371
|
+
importer: args.importer,
|
|
372
|
+
resolveDir: args.resolveDir,
|
|
373
|
+
kind: args.kind,
|
|
374
|
+
pluginData: KIT_SOURCE_RESOLVE
|
|
375
|
+
});
|
|
376
|
+
if (resolved.errors.length > 0 || resolved.external || !keepsKitSourceEffects(resolved.path, state.externalPackageDirs)) return;
|
|
377
|
+
return {
|
|
378
|
+
path: resolved.path,
|
|
379
|
+
namespace: resolved.namespace,
|
|
380
|
+
suffix: resolved.suffix,
|
|
381
|
+
sideEffects: true
|
|
382
|
+
};
|
|
383
|
+
});
|
|
384
|
+
build.onResolve({ filter: /^[^./\0]/ }, async (args) => {
|
|
385
|
+
if (args.path.startsWith("animus:")) return void 0;
|
|
386
|
+
if (isEsbuildExternal(args.path, build.initialOptions.external)) return;
|
|
387
|
+
await joinPipeline();
|
|
388
|
+
const target = state.kitRedirects.get(args.path);
|
|
389
|
+
if (target === void 0) return void 0;
|
|
390
|
+
const sideEffects = state.kitSideEffects.get(args.path);
|
|
391
|
+
return sideEffects === void 0 ? { path: target } : {
|
|
392
|
+
path: target,
|
|
393
|
+
sideEffects
|
|
394
|
+
};
|
|
395
|
+
});
|
|
396
|
+
},
|
|
397
|
+
config(buildOptions) {
|
|
398
|
+
esbuildOptions = buildOptions;
|
|
399
|
+
hostConditions = buildOptions.conditions ?? [];
|
|
400
|
+
watching = () => watch;
|
|
401
|
+
buildOptions.define = {
|
|
402
|
+
...buildOptions.define,
|
|
403
|
+
__ANIMUS_DEV__: JSON.stringify(effectiveMode() === "development")
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
}
|
|
318
407
|
};
|
|
408
|
+
/** Rspack's resolve data carries no rule settings, so a module rule per
|
|
409
|
+
* classification marks each redirect target, read when it resolves. */
|
|
410
|
+
function classifyRspackRedirects(compiler) {
|
|
411
|
+
const classification = (resource) => {
|
|
412
|
+
let pure = false;
|
|
413
|
+
for (const [specifier, target] of state.kitRedirects) {
|
|
414
|
+
if (target !== resource) continue;
|
|
415
|
+
const sideEffects = state.kitSideEffects.get(specifier);
|
|
416
|
+
if (sideEffects === true) return true;
|
|
417
|
+
if (sideEffects === false) pure = true;
|
|
418
|
+
}
|
|
419
|
+
return pure ? false : void 0;
|
|
420
|
+
};
|
|
421
|
+
compiler.options.module.rules.push({
|
|
422
|
+
test: (resource) => classification(resource) === true,
|
|
423
|
+
sideEffects: true
|
|
424
|
+
}, {
|
|
425
|
+
test: (resource) => classification(resource) === false,
|
|
426
|
+
sideEffects: false
|
|
427
|
+
}, {
|
|
428
|
+
test: (resource) => keepsKitSourceEffects(resource, state.externalPackageDirs),
|
|
429
|
+
issuer: (issuer) => state.externalPackageDirs.some((dir) => isPathWithinRoot(dir, issuer)),
|
|
430
|
+
sideEffects: true
|
|
431
|
+
});
|
|
432
|
+
}
|
|
319
433
|
/** Webpack would classify a redirect target by its own path against the
|
|
320
434
|
* package's `sideEffects`, so the replaced entry's classification is set
|
|
321
435
|
* as a rule's would be. Rspack's resolve data is not known to carry
|
|
@@ -324,14 +438,17 @@ const unpluginFactory = (rawOptions, meta) => {
|
|
|
324
438
|
compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, (nmf) => {
|
|
325
439
|
nmf.hooks.afterResolve.tap(PLUGIN_NAME, (resolveData) => {
|
|
326
440
|
const { createData } = resolveData;
|
|
441
|
+
if (!createData?.settings || createData.resource === void 0) return;
|
|
327
442
|
const sideEffects = state.kitSideEffects.get(resolveData.request);
|
|
328
|
-
if (sideEffects
|
|
329
|
-
createData.settings.sideEffects =
|
|
443
|
+
if (sideEffects !== void 0 && createData.resource === state.kitRedirects.get(resolveData.request)) createData.settings.sideEffects = sideEffects;
|
|
444
|
+
else if (keepsKitSourceEffects(moduleFilePath(createData.resource), state.externalPackageDirs)) createData.settings.sideEffects = true;
|
|
330
445
|
});
|
|
331
446
|
});
|
|
332
447
|
}
|
|
333
448
|
function wireWebpackLike(compiler) {
|
|
334
449
|
modeOracle = compiler.options.mode === "development" ? "development" : "production";
|
|
450
|
+
hostConditions = (compiler.options.resolve?.conditionNames ?? []).filter((name) => name !== "...");
|
|
451
|
+
watching = () => compiler.watchMode === true;
|
|
335
452
|
const DefinePlugin = compiler.webpack?.DefinePlugin ?? compiler.rspack?.DefinePlugin;
|
|
336
453
|
if (!DefinePlugin) throw new Error("[animus] compiler exposes no DefinePlugin — cannot supply the __ANIMUS_DEV__ dev-signal define");
|
|
337
454
|
new DefinePlugin({ __ANIMUS_DEV__: JSON.stringify(effectiveMode() === "development") }).apply(compiler);
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAIV,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB;0DAC0D;AAC1D,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAQtD,eAAO,MAAM,cAAc,eAAe,CAAC;AAQ3C,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC;wCACoC;IACpC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EACT,CAAC,CACC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,KACjB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC,GAC9C,IAAI,CAAC;IACT,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,wBAAgB,eAAe,IAAI,SAAS,CAc3C;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,qBAAqB,GAAG,iBAAiB,CAAC,GAChE,OAAO,CAMT;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,EAChB,SAAS,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IACmB,GAC9C,IAAI,CAKN;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACxB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASzD;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,MAAM,GAAG,IAAI,CAGf;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,GAAG,EAAE;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,CACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,KACjB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC;CAC/C,GACA,MAAM,GAAG,IAAI,CAIf;AAsHD,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C,qBAAqB,GAAG,SAAS,CA2gBlC,CAAC"}
|
package/dist/esbuild.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-BqEruPuj.cjs");
|
|
6
6
|
//#region src/esbuild.ts
|
|
7
7
|
const animusEsbuild = (0, require("unplugin").createEsbuildPlugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/esbuild.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { AnimusUnpluginOptions } from './options';
|
|
2
|
-
export declare const animusEsbuild: (options?: import("
|
|
2
|
+
export declare const animusEsbuild: (options?: import("./options").AnimusUnpluginOptions | undefined) => import("unplugin").EsbuildPlugin;
|
|
3
3
|
export default animusEsbuild;
|
|
4
4
|
//# sourceMappingURL=esbuild.d.ts.map
|
package/dist/esbuild.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild.d.ts","sourceRoot":"","sources":["../src/esbuild.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"esbuild.d.ts","sourceRoot":"","sources":["../src/esbuild.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,eAAO,MAAM,aAAa,uGAAuC,CAAC;eAEnD,aAAa"}
|
package/dist/esbuild.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-BqEruPuj.cjs");
|
|
6
6
|
//#region src/index.ts
|
|
7
7
|
const animusUnplugin = (0, require("unplugin").createUnplugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unpluginFactory } from './core';
|
|
2
2
|
export type { AnimusUnpluginOptions } from './options';
|
|
3
3
|
export { unpluginFactory };
|
|
4
|
-
export declare const animusUnplugin: import("unplugin").UnpluginInstance<import("
|
|
4
|
+
export declare const animusUnplugin: import("unplugin").UnpluginInstance<import("./options").AnimusUnpluginOptions | undefined, boolean>;
|
|
5
5
|
export default animusUnplugin;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,eAAO,MAAM,cAAc,qGAAkC,CAAC;eAE/C,cAAc"}
|
package/dist/index.mjs
CHANGED
package/dist/options.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
/** rollup and esbuild expose no root authority a plugin could derive, so
|
|
2
2
|
* `root` is the explicit option, defaulting to the working directory. */
|
|
3
3
|
import type { AnimusCoreOptions, AnimusMode } from '@animus-ui/extract/pipeline';
|
|
4
|
-
export
|
|
4
|
+
export interface AnimusUnpluginOptions extends AnimusCoreOptions {
|
|
5
|
+
/**
|
|
6
|
+
* esbuild only: set this where you call `context().watch()` or `serve()`.
|
|
7
|
+
* Every turn, the first included, then reports an error-level diagnostic
|
|
8
|
+
* and publishes. Without it, esbuild is a one-shot build, which an
|
|
9
|
+
* error-level diagnostic fails. Other hosts detect a watch themselves.
|
|
10
|
+
*/
|
|
11
|
+
watch?: boolean;
|
|
12
|
+
}
|
|
5
13
|
export interface ResolvedHostOptions {
|
|
6
14
|
root: string;
|
|
7
15
|
options: AnimusCoreOptions;
|
|
16
|
+
/** The esbuild adapter's `watch` option. */
|
|
17
|
+
watch: boolean;
|
|
8
18
|
}
|
|
9
19
|
export declare function resolveHostOptions(raw: AnimusUnpluginOptions | undefined, cwd?: string): ResolvedHostOptions;
|
|
10
20
|
export declare function resolveHostMode(explicit: AnimusMode | undefined, oracle: AnimusMode | null): AnimusMode;
|
package/dist/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;0EAC0E;AAU1E,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACX,MAAM,6BAA6B,CAAC;AAErC,MAAM,
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;0EAC0E;AAU1E,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACX,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAoBD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,iBAAiB,CAAC;IAC3B,4CAA4C;IAC5C,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,qBAAqB,GAAG,SAAS,EACtC,GAAG,GAAE,MAAsB,GAC1B,mBAAmB,CAarB;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,UAAU,GAAG,SAAS,EAChC,MAAM,EAAE,UAAU,GAAG,IAAI,GACxB,UAAU,CAEZ"}
|
package/dist/rollup.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-BqEruPuj.cjs");
|
|
6
6
|
//#region src/rollup.ts
|
|
7
7
|
const animusRollup = (0, require("unplugin").createRollupPlugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/rollup.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { AnimusUnpluginOptions } from './options';
|
|
2
|
-
export declare const animusRollup: (options?: import("
|
|
2
|
+
export declare const animusRollup: (options?: import("./options").AnimusUnpluginOptions | undefined) => import("unplugin").RollupPlugin<any>[] | import("unplugin").RollupPlugin<any>;
|
|
3
3
|
export default animusRollup;
|
|
4
4
|
//# sourceMappingURL=rollup.d.ts.map
|
package/dist/rollup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../src/rollup.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../src/rollup.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,eAAO,MAAM,YAAY,oJAAsC,CAAC;eAEjD,YAAY"}
|
package/dist/rollup.mjs
CHANGED
package/dist/rspack.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-BqEruPuj.cjs");
|
|
6
6
|
//#region src/rspack.ts
|
|
7
7
|
const animusRspack = (0, require("unplugin").createRspackPlugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/rspack.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { AnimusUnpluginOptions } from './options';
|
|
2
|
-
export declare const animusRspack: (options?: import("
|
|
2
|
+
export declare const animusRspack: (options?: import("./options").AnimusUnpluginOptions | undefined) => RspackPluginInstance;
|
|
3
3
|
export default animusRspack;
|
|
4
4
|
//# sourceMappingURL=rspack.d.ts.map
|
package/dist/rspack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../src/rspack.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,eAAO,MAAM,YAAY,2FAAsC,CAAC;eAEjD,YAAY"}
|
package/dist/rspack.mjs
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_core = require("./core-
|
|
5
|
+
const require_core = require("./core-BqEruPuj.cjs");
|
|
6
6
|
//#region src/webpack.ts
|
|
7
7
|
const animusWebpack = (0, require("unplugin").createWebpackPlugin)(require_core.unpluginFactory);
|
|
8
8
|
//#endregion
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { AnimusUnpluginOptions } from './options';
|
|
2
|
-
export declare const animusWebpack: (options?: import("
|
|
2
|
+
export declare const animusWebpack: (options?: import("./options").AnimusUnpluginOptions | undefined) => import("unplugin").WebpackPluginInstance;
|
|
3
3
|
export default animusWebpack;
|
|
4
4
|
//# sourceMappingURL=webpack.d.ts.map
|
package/dist/webpack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,eAAO,MAAM,aAAa,+GAAuC,CAAC;eAEnD,aAAa"}
|
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/unplugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "Animus transform host for non-plugin bundlers — unplugin-based rollup/esbuild/rspack/webpack entry points over the one extraction session",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animus",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"compile": "tsc --noEmit"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@animus-ui/extract": "0.1.
|
|
60
|
+
"@animus-ui/extract": "0.1.24",
|
|
61
61
|
"unplugin": "^3.3.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|