unplugin-isolated-decl 0.10.0 → 0.10.2
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/esbuild.cjs +1 -1
- package/dist/esbuild.js +1 -1
- package/dist/farm.cjs +1 -1
- package/dist/farm.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/rolldown.cjs +1 -1
- package/dist/rolldown.js +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.js +1 -1
- package/dist/{src-BG0S9gFu.js → src-Yy6QF_tM.js} +13 -9
- package/dist/{src-DPQU5TkD.cjs → src-h7U2Vqcv.cjs} +13 -9
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/package.json +1 -1
package/dist/esbuild.cjs
CHANGED
package/dist/esbuild.js
CHANGED
package/dist/farm.cjs
CHANGED
package/dist/farm.js
CHANGED
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
package/dist/rolldown.cjs
CHANGED
package/dist/rolldown.js
CHANGED
package/dist/rollup.cjs
CHANGED
package/dist/rollup.js
CHANGED
|
@@ -113,7 +113,7 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
|
|
|
113
113
|
const options = resolveOptions(rawOptions);
|
|
114
114
|
const filter = createFilter(options.include, options.exclude);
|
|
115
115
|
let farmPluginContext;
|
|
116
|
-
|
|
116
|
+
let outputFiles = Object.create(null);
|
|
117
117
|
function addOutput(filename, output) {
|
|
118
118
|
const name = stripExt(filename);
|
|
119
119
|
const ext = path.extname(filename);
|
|
@@ -129,6 +129,7 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
|
|
|
129
129
|
name: "unplugin-isolated-decl",
|
|
130
130
|
buildStart() {
|
|
131
131
|
farmPluginContext = this;
|
|
132
|
+
outputFiles = Object.create(null);
|
|
132
133
|
},
|
|
133
134
|
transformInclude: (id) => filter(id),
|
|
134
135
|
transform(code, id) {
|
|
@@ -215,26 +216,29 @@ else {
|
|
|
215
216
|
const { input } = inputOptions;
|
|
216
217
|
const { inputBase, entryMap } = resolveEntry(input, options.inputBase);
|
|
217
218
|
debug("[rollup] input base:", inputBase);
|
|
218
|
-
|
|
219
|
+
const { entryFileNames = "[name].js", dir: outDir } = outputOptions;
|
|
219
220
|
if (typeof entryFileNames !== "string") return this.error("entryFileNames must be a string");
|
|
220
|
-
if (options.extraOutdir) entryFileNames = path.join(options.extraOutdir, entryFileNames);
|
|
221
221
|
for (const [srcFilename, { s, imports, map, ext }] of Object.entries(outputFiles)) {
|
|
222
|
-
|
|
222
|
+
let emitName = rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename);
|
|
223
223
|
let source = s.toString();
|
|
224
224
|
if (options.patchCjsDefaultExport && emitName.endsWith(".d.cts")) source = patchCjsDefaultExport(source);
|
|
225
|
+
if (options.extraOutdir) emitName = path.join(options.extraOutdir || "", emitName);
|
|
225
226
|
debug("[rollup] emit dts file:", emitName);
|
|
227
|
+
const originalFileName = srcFilename + ext;
|
|
226
228
|
if (options.sourceMap && map && outDir) {
|
|
227
229
|
source = appendMapUrl(source, emitName);
|
|
228
230
|
this.emitFile({
|
|
229
231
|
type: "asset",
|
|
230
232
|
fileName: `${emitName}.map`,
|
|
231
|
-
source: generateDtsMap(map,
|
|
233
|
+
source: generateDtsMap(map, originalFileName, path.join(outDir, emitName)),
|
|
234
|
+
originalFileName
|
|
232
235
|
});
|
|
233
236
|
}
|
|
234
237
|
this.emitFile({
|
|
235
238
|
type: "asset",
|
|
236
239
|
fileName: emitName,
|
|
237
|
-
source
|
|
240
|
+
source,
|
|
241
|
+
originalFileName
|
|
238
242
|
});
|
|
239
243
|
}
|
|
240
244
|
}
|
|
@@ -250,12 +254,12 @@ else {
|
|
|
250
254
|
]);
|
|
251
255
|
output.entryFilename = "[entryName].[ext]";
|
|
252
256
|
output.entryFilename = output.entryFilename.replace("[ext]", extFormatMap.get(output.format || "esm") || "js");
|
|
253
|
-
|
|
254
|
-
if (options.extraOutdir) entryFileNames = path.join(options.extraOutdir, entryFileNames);
|
|
257
|
+
const entryFileNames = output.entryFilename;
|
|
255
258
|
for (const [srcFilename, { s, imports, map, ext }] of Object.entries(outputFiles)) {
|
|
256
|
-
|
|
259
|
+
let emitName = rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename);
|
|
257
260
|
let source = s.toString();
|
|
258
261
|
if (options.patchCjsDefaultExport && emitName.endsWith(".d.cts")) source = patchCjsDefaultExport(source);
|
|
262
|
+
if (options.extraOutdir) emitName = path.join(options.extraOutdir || "", emitName);
|
|
259
263
|
debug("[farm] emit dts file:", emitName);
|
|
260
264
|
const outDir = output.path;
|
|
261
265
|
if (options.sourceMap && map && outDir) {
|
|
@@ -114,7 +114,7 @@ const IsolatedDecl = (0, unplugin.createUnplugin)((rawOptions = {}) => {
|
|
|
114
114
|
const options = resolveOptions(rawOptions);
|
|
115
115
|
const filter = (0, __rollup_pluginutils.createFilter)(options.include, options.exclude);
|
|
116
116
|
let farmPluginContext;
|
|
117
|
-
|
|
117
|
+
let outputFiles = Object.create(null);
|
|
118
118
|
function addOutput(filename, output) {
|
|
119
119
|
const name = stripExt(filename);
|
|
120
120
|
const ext = node_path.default.extname(filename);
|
|
@@ -130,6 +130,7 @@ const IsolatedDecl = (0, unplugin.createUnplugin)((rawOptions = {}) => {
|
|
|
130
130
|
name: "unplugin-isolated-decl",
|
|
131
131
|
buildStart() {
|
|
132
132
|
farmPluginContext = this;
|
|
133
|
+
outputFiles = Object.create(null);
|
|
133
134
|
},
|
|
134
135
|
transformInclude: (id) => filter(id),
|
|
135
136
|
transform(code, id) {
|
|
@@ -216,26 +217,29 @@ else {
|
|
|
216
217
|
const { input } = inputOptions;
|
|
217
218
|
const { inputBase, entryMap } = resolveEntry(input, options.inputBase);
|
|
218
219
|
debug$1("[rollup] input base:", inputBase);
|
|
219
|
-
|
|
220
|
+
const { entryFileNames = "[name].js", dir: outDir } = outputOptions;
|
|
220
221
|
if (typeof entryFileNames !== "string") return this.error("entryFileNames must be a string");
|
|
221
|
-
if (options.extraOutdir) entryFileNames = node_path.default.join(options.extraOutdir, entryFileNames);
|
|
222
222
|
for (const [srcFilename, { s, imports, map, ext }] of Object.entries(outputFiles)) {
|
|
223
|
-
|
|
223
|
+
let emitName = rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename);
|
|
224
224
|
let source = s.toString();
|
|
225
225
|
if (options.patchCjsDefaultExport && emitName.endsWith(".d.cts")) source = patchCjsDefaultExport(source);
|
|
226
|
+
if (options.extraOutdir) emitName = node_path.default.join(options.extraOutdir || "", emitName);
|
|
226
227
|
debug$1("[rollup] emit dts file:", emitName);
|
|
228
|
+
const originalFileName = srcFilename + ext;
|
|
227
229
|
if (options.sourceMap && map && outDir) {
|
|
228
230
|
source = require_transformer.appendMapUrl(source, emitName);
|
|
229
231
|
this.emitFile({
|
|
230
232
|
type: "asset",
|
|
231
233
|
fileName: `${emitName}.map`,
|
|
232
|
-
source: require_transformer.generateDtsMap(map,
|
|
234
|
+
source: require_transformer.generateDtsMap(map, originalFileName, node_path.default.join(outDir, emitName)),
|
|
235
|
+
originalFileName
|
|
233
236
|
});
|
|
234
237
|
}
|
|
235
238
|
this.emitFile({
|
|
236
239
|
type: "asset",
|
|
237
240
|
fileName: emitName,
|
|
238
|
-
source
|
|
241
|
+
source,
|
|
242
|
+
originalFileName
|
|
239
243
|
});
|
|
240
244
|
}
|
|
241
245
|
}
|
|
@@ -251,12 +255,12 @@ else {
|
|
|
251
255
|
]);
|
|
252
256
|
output.entryFilename = "[entryName].[ext]";
|
|
253
257
|
output.entryFilename = output.entryFilename.replace("[ext]", extFormatMap.get(output.format || "esm") || "js");
|
|
254
|
-
|
|
255
|
-
if (options.extraOutdir) entryFileNames = node_path.default.join(options.extraOutdir, entryFileNames);
|
|
258
|
+
const entryFileNames = output.entryFilename;
|
|
256
259
|
for (const [srcFilename, { s, imports, map, ext }] of Object.entries(outputFiles)) {
|
|
257
|
-
|
|
260
|
+
let emitName = rewriteImports(s, options, imports, entryMap, inputBase, entryFileNames, srcFilename);
|
|
258
261
|
let source = s.toString();
|
|
259
262
|
if (options.patchCjsDefaultExport && emitName.endsWith(".d.cts")) source = patchCjsDefaultExport(source);
|
|
263
|
+
if (options.extraOutdir) emitName = node_path.default.join(options.extraOutdir || "", emitName);
|
|
260
264
|
debug$1("[farm] emit dts file:", emitName);
|
|
261
265
|
const outDir = output.path;
|
|
262
266
|
if (options.sourceMap && map && outDir) {
|
package/dist/vite.cjs
CHANGED
package/dist/vite.js
CHANGED