@sanity/pkg-utils 2.0.3 → 2.0.4-beta.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/dist/_chunks/{build-47518e48.cjs → build-77dacddc.cjs} +7 -11
- package/dist/_chunks/{build-47518e48.cjs.map → build-77dacddc.cjs.map} +1 -1
- package/dist/_chunks/buildAction-15e03999.cjs +18 -0
- package/dist/_chunks/{buildAction-0eb8c03a.cjs.map → buildAction-15e03999.cjs.map} +1 -1
- package/dist/_chunks/{check-5451f989.cjs → check-4c6bb15d.cjs} +2 -2
- package/dist/_chunks/{check-5451f989.cjs.map → check-4c6bb15d.cjs.map} +1 -1
- package/dist/_chunks/checkAction-fa6a293a.cjs +17 -0
- package/dist/_chunks/{checkAction-f67b99f8.cjs.map → checkAction-fa6a293a.cjs.map} +1 -1
- package/dist/_chunks/{index-583ee0d8.cjs → index-03f2cc83.cjs} +52 -40
- package/dist/_chunks/index-03f2cc83.cjs.map +1 -0
- package/dist/_chunks/{resolveBuildContext-2fe45294.cjs → resolveBuildContext-65b5c5d5.cjs} +17 -20
- package/dist/_chunks/{resolveBuildContext-2fe45294.cjs.map → resolveBuildContext-65b5c5d5.cjs.map} +1 -1
- package/dist/_chunks/{watch-563b0b60.cjs → watch-2663890e.cjs} +7 -11
- package/dist/_chunks/{watch-563b0b60.cjs.map → watch-2663890e.cjs.map} +1 -1
- package/dist/_chunks/watchAction-808ed88d.cjs +17 -0
- package/dist/_chunks/{watchAction-e6c84b20.cjs.map → watchAction-808ed88d.cjs.map} +1 -1
- package/dist/cli.cjs +4 -4
- package/dist/index.cjs +5 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +74 -58
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
- package/src/node/tasks/rollup/resolveRollupConfig.ts +7 -2
- package/dist/_chunks/buildAction-0eb8c03a.cjs +0 -49
- package/dist/_chunks/checkAction-f67b99f8.cjs +0 -31
- package/dist/_chunks/index-583ee0d8.cjs.map +0 -1
- package/dist/_chunks/watchAction-e6c84b20.cjs +0 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchAction-
|
|
1
|
+
{"version":3,"file":"watchAction-808ed88d.cjs","sources":["../../src/cli/watchAction.ts"],"sourcesContent":["import {watch} from '../node/watch'\nimport {handleError} from './handleError'\n\nexport async function watchAction(options: {strict?: boolean; tsconfig?: string}): Promise<void> {\n try {\n await watch({\n cwd: process.cwd(),\n strict: options.strict,\n tsconfig: options.tsconfig,\n })\n } catch (err) {\n handleError(err)\n }\n}\n"],"names":["watchAction","options","watch","cwd","process","strict","tsconfig","err","handleError"],"mappings":";;;;AAGA,eAAsBA,YAAYC,OAA+D,EAAA;EAC3F,IAAA;IACF,MAAMC,WAAM,CAAA;MACVC,GAAA,EAAKC,QAAQD,GAAI,EAAA;MACjBE,QAAQJ,OAAQ,CAAAI,MAAA;MAChBC,UAAUL,OAAQ,CAAAK;IAAA,CACnB,CAAA;WACMC,GAAP,EAAA;IACAC,WAAA,CAAAA,WAAA,CAAYD,GAAG,CAAA;EACjB;AACF;"}
|
package/dist/cli.cjs
CHANGED
|
@@ -7,13 +7,13 @@ function _interopDefaultCompat(e) {
|
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
var cac__default = /*#__PURE__*/_interopDefaultCompat(cac);
|
|
10
|
-
var version = "2.0.
|
|
10
|
+
var version = "2.0.4-beta.1";
|
|
11
11
|
const cli = cac__default.default();
|
|
12
12
|
cli.command("", "Check").option("--strict", "Strict mode").option("--tsconfig [tsconfig]", "[string] tsconfig.json").action(async options => {
|
|
13
13
|
const {
|
|
14
14
|
checkAction: statusAction
|
|
15
15
|
} = await Promise.resolve().then(function () {
|
|
16
|
-
return require('./_chunks/checkAction-
|
|
16
|
+
return require('./_chunks/checkAction-fa6a293a.cjs');
|
|
17
17
|
});
|
|
18
18
|
return statusAction(options);
|
|
19
19
|
});
|
|
@@ -21,7 +21,7 @@ cli.command("build", "Build package").option("--emitDeclarationOnly", "Emit d.ts
|
|
|
21
21
|
const {
|
|
22
22
|
buildAction
|
|
23
23
|
} = await Promise.resolve().then(function () {
|
|
24
|
-
return require('./_chunks/buildAction-
|
|
24
|
+
return require('./_chunks/buildAction-15e03999.cjs');
|
|
25
25
|
});
|
|
26
26
|
return buildAction(options);
|
|
27
27
|
});
|
|
@@ -29,7 +29,7 @@ cli.command("watch", "Watch package").option("--strict", "Strict mode").option("
|
|
|
29
29
|
const {
|
|
30
30
|
watchAction
|
|
31
31
|
} = await Promise.resolve().then(function () {
|
|
32
|
-
return require('./_chunks/watchAction-
|
|
32
|
+
return require('./_chunks/watchAction-808ed88d.cjs');
|
|
33
33
|
});
|
|
34
34
|
return watchAction(options);
|
|
35
35
|
});
|
package/dist/index.cjs
CHANGED
|
@@ -3,46 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var build = require('./_chunks/build-
|
|
7
|
-
var check = require('./_chunks/check-
|
|
8
|
-
var resolveBuildContext = require('./_chunks/resolveBuildContext-
|
|
9
|
-
var index = require('./_chunks/index-
|
|
10
|
-
var watch = require('./_chunks/watch-
|
|
11
|
-
require('fs/promises');
|
|
12
|
-
require('pkg-up');
|
|
13
|
-
require('typescript');
|
|
14
|
-
require('fs');
|
|
15
|
-
require('path');
|
|
16
|
-
require('chalk');
|
|
17
|
-
require('esbuild');
|
|
18
|
-
require('treeify');
|
|
19
|
-
require('pretty-bytes');
|
|
20
|
-
require('esbuild-register/dist/node');
|
|
21
|
-
require('find-config');
|
|
22
|
-
require('zod');
|
|
23
|
-
require('browserslist');
|
|
24
|
-
require('rxjs');
|
|
25
|
-
require('util');
|
|
26
|
-
require('rimraf');
|
|
27
|
-
require('@microsoft/api-extractor');
|
|
28
|
-
require('mkdirp');
|
|
29
|
-
require('prettier');
|
|
30
|
-
require('@microsoft/tsdoc-config');
|
|
31
|
-
require('jsonc-parser');
|
|
32
|
-
require('recast');
|
|
33
|
-
require('recast/parsers/typescript');
|
|
34
|
-
require('rollup');
|
|
35
|
-
require('@rollup/plugin-alias');
|
|
36
|
-
require('@rollup/plugin-babel');
|
|
37
|
-
require('@rollup/plugin-commonjs');
|
|
38
|
-
require('@rollup/plugin-json');
|
|
39
|
-
require('@rollup/plugin-node-resolve');
|
|
40
|
-
require('@rollup/plugin-replace');
|
|
41
|
-
require('@rollup/plugin-terser');
|
|
42
|
-
require('rollup-plugin-esbuild');
|
|
43
|
-
require('rxjs/operators');
|
|
44
|
-
require('globby');
|
|
45
|
-
require('chokidar');
|
|
6
|
+
var build = require('./_chunks/build-77dacddc.cjs');
|
|
7
|
+
var check = require('./_chunks/check-4c6bb15d.cjs');
|
|
8
|
+
var resolveBuildContext = require('./_chunks/resolveBuildContext-65b5c5d5.cjs');
|
|
9
|
+
var index = require('./_chunks/index-03f2cc83.cjs');
|
|
10
|
+
var watch = require('./_chunks/watch-2663890e.cjs');
|
|
46
11
|
function defineConfig(configOptions) {
|
|
47
12
|
return configOptions;
|
|
48
13
|
}
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/node/core/config/defineConfig.ts"],"sourcesContent":["import {PkgConfigOptions} from './types'\n\n/** @public */\nexport function defineConfig(configOptions: PkgConfigOptions): PkgConfigOptions {\n return configOptions\n}\n"],"names":["defineConfig","configOptions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/node/core/config/defineConfig.ts"],"sourcesContent":["import {PkgConfigOptions} from './types'\n\n/** @public */\nexport function defineConfig(configOptions: PkgConfigOptions): PkgConfigOptions {\n return configOptions\n}\n"],"names":["defineConfig","configOptions"],"mappings":";;;;;;;;;;AAGO,SAASA,aAAaC,aAAmD,EAAA;EACvE,OAAAA,aAAA;AACT;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
const _excluded = ["_path"];
|
|
2
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
8
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
1
|
import path from 'path';
|
|
10
2
|
import { register } from 'esbuild-register/dist/node';
|
|
11
3
|
import pkgUp from 'pkg-up';
|
|
@@ -142,9 +134,10 @@ const pkgSchema = z.object({
|
|
|
142
134
|
});
|
|
143
135
|
function validatePkg(input) {
|
|
144
136
|
const pkg = pkgSchema.parse(input);
|
|
145
|
-
return
|
|
137
|
+
return {
|
|
138
|
+
...pkg,
|
|
146
139
|
type: pkg.type || "commonjs"
|
|
147
|
-
}
|
|
140
|
+
};
|
|
148
141
|
}
|
|
149
142
|
async function loadPkg(options) {
|
|
150
143
|
const {
|
|
@@ -257,10 +250,11 @@ function parseExports(options) {
|
|
|
257
250
|
}
|
|
258
251
|
Object.assign(rootExport, exportEntry);
|
|
259
252
|
} else {
|
|
260
|
-
const extraExport =
|
|
253
|
+
const extraExport = {
|
|
261
254
|
_exported: true,
|
|
262
|
-
_path: exportPath
|
|
263
|
-
|
|
255
|
+
_path: exportPath,
|
|
256
|
+
...exportEntry
|
|
257
|
+
};
|
|
264
258
|
extraExports.push(extraExport);
|
|
265
259
|
}
|
|
266
260
|
} else {
|
|
@@ -292,7 +286,9 @@ function getPkgExtMap(options) {
|
|
|
292
286
|
const {
|
|
293
287
|
legacyExports
|
|
294
288
|
} = options;
|
|
295
|
-
const ret =
|
|
289
|
+
const ret = {
|
|
290
|
+
...DEFAULT_PKG_EXT_MAP
|
|
291
|
+
};
|
|
296
292
|
if (legacyExports) {
|
|
297
293
|
ret["commonjs"] = {
|
|
298
294
|
commonjs: ".js",
|
|
@@ -481,12 +477,13 @@ async function resolveBuildContext(options) {
|
|
|
481
477
|
strict
|
|
482
478
|
}).reduce((acc, x) => {
|
|
483
479
|
const {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
return
|
|
480
|
+
_path: exportPath,
|
|
481
|
+
...exportEntry
|
|
482
|
+
} = x;
|
|
483
|
+
return {
|
|
484
|
+
...acc,
|
|
488
485
|
[exportPath]: exportEntry
|
|
489
|
-
}
|
|
486
|
+
};
|
|
490
487
|
}, {});
|
|
491
488
|
const exports = resolveConfigProperty(config == null ? void 0 : config.exports, parsedExports);
|
|
492
489
|
const parsedExternal = [...(pkg.dependencies ? Object.keys(pkg.dependencies) : []), ...(pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [])];
|
|
@@ -544,9 +541,10 @@ function resolveBuildTasks(ctx) {
|
|
|
544
541
|
const tasks = [];
|
|
545
542
|
const exports = Object.entries(ctx.exports || {}).map(_ref2 => {
|
|
546
543
|
let [_path, exp] = _ref2;
|
|
547
|
-
return
|
|
548
|
-
_path
|
|
549
|
-
|
|
544
|
+
return {
|
|
545
|
+
_path,
|
|
546
|
+
...exp
|
|
547
|
+
};
|
|
550
548
|
});
|
|
551
549
|
const dtsTask = {
|
|
552
550
|
type: "build:dts",
|
|
@@ -727,13 +725,14 @@ async function buildTypes(options) {
|
|
|
727
725
|
tsconfig,
|
|
728
726
|
strict = false
|
|
729
727
|
} = options;
|
|
730
|
-
const compilerOptions =
|
|
728
|
+
const compilerOptions = {
|
|
729
|
+
...tsconfig.options,
|
|
731
730
|
declaration: true,
|
|
732
731
|
declarationDir: outDir,
|
|
733
732
|
emitDeclarationOnly: true,
|
|
734
733
|
noEmit: false,
|
|
735
734
|
outDir
|
|
736
|
-
}
|
|
735
|
+
};
|
|
737
736
|
const program = ts.createProgram(tsconfig.fileNames, compilerOptions);
|
|
738
737
|
const emitResult = program.emit();
|
|
739
738
|
const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
|
@@ -807,15 +806,18 @@ async function createTSDocConfig(opts) {
|
|
|
807
806
|
syntaxKind: t.syntaxKind,
|
|
808
807
|
allowMultiple: t.allowMultiple
|
|
809
808
|
})));
|
|
810
|
-
const supportForTags =
|
|
809
|
+
const supportForTags = {
|
|
810
|
+
...tsDocBaseConfig.supportForTags
|
|
811
|
+
};
|
|
811
812
|
for (const customTag of customTags) {
|
|
812
813
|
supportForTags["@".concat(customTag.name)] = true;
|
|
813
814
|
}
|
|
814
|
-
return TSDocConfigFile.loadFromObject(
|
|
815
|
+
return TSDocConfigFile.loadFromObject({
|
|
816
|
+
...tsDocBaseConfig,
|
|
815
817
|
noStandardTags: false,
|
|
816
818
|
tagDefinitions,
|
|
817
819
|
supportForTags
|
|
818
|
-
})
|
|
820
|
+
});
|
|
819
821
|
}
|
|
820
822
|
async function extractModuleBlocksFromTypes(_ref3) {
|
|
821
823
|
let {
|
|
@@ -955,9 +957,10 @@ async function extractTypes(options) {
|
|
|
955
957
|
tsOutDir: tmpPath
|
|
956
958
|
});
|
|
957
959
|
const code = [typesBuf.toString(), ...moduleBlocks].join("\n\n");
|
|
958
|
-
await fs.writeFile(typesPath, prettier.format(code,
|
|
960
|
+
await fs.writeFile(typesPath, prettier.format(code, {
|
|
961
|
+
...prettierConfig,
|
|
959
962
|
filepath: typesPath
|
|
960
|
-
}))
|
|
963
|
+
}));
|
|
961
964
|
files.push({
|
|
962
965
|
type: "types",
|
|
963
966
|
path: typesPath
|
|
@@ -1167,9 +1170,10 @@ function resolveRollupConfig(ctx, buildTask) {
|
|
|
1167
1170
|
return [key, path.resolve(cwd, ((_a2 = ts.config) == null ? void 0 : _a2.options.baseUrl) || ".", val[0])];
|
|
1168
1171
|
}));
|
|
1169
1172
|
const entries = buildTask.entries.map(entry => {
|
|
1170
|
-
return
|
|
1173
|
+
return {
|
|
1174
|
+
...entry,
|
|
1171
1175
|
name: path.relative(outDir, entry.output).replace(/\.[^/.]+$/, "")
|
|
1172
|
-
}
|
|
1176
|
+
};
|
|
1173
1177
|
}, {});
|
|
1174
1178
|
const exportIds = _exports && Object.keys(_exports).map(exportPath => path.join(pkg.name, exportPath));
|
|
1175
1179
|
const sourcePaths = _exports && Object.values(_exports).map(e => path.resolve(cwd, e.source));
|
|
@@ -1179,22 +1183,29 @@ function resolveRollupConfig(ctx, buildTask) {
|
|
|
1179
1183
|
}));
|
|
1180
1184
|
const defaultPlugins = [replace({
|
|
1181
1185
|
preventAssignment: true,
|
|
1182
|
-
values:
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1186
|
+
values: {
|
|
1187
|
+
...(pkg.name === "@sanity/pkg-utils" ? {
|
|
1188
|
+
...replacements
|
|
1189
|
+
} : {
|
|
1190
|
+
"process.env.PKG_FILE_PATH": arg => {
|
|
1191
|
+
const sourcePath = "./" + path.relative(cwd, arg);
|
|
1192
|
+
const entry = entries.find(e => e.source === sourcePath);
|
|
1193
|
+
if (!entry) {
|
|
1194
|
+
console.error("could not find source entry: ".concat(sourcePath));
|
|
1195
|
+
return "null";
|
|
1196
|
+
}
|
|
1197
|
+
return JSON.stringify(path.relative(cwd, path.resolve(outDir, entry.name + outputExt)));
|
|
1198
|
+
},
|
|
1199
|
+
"process.env.PKG_FORMAT": JSON.stringify(format),
|
|
1200
|
+
"process.env.PKG_RUNTIME": JSON.stringify(runtime),
|
|
1201
|
+
"process.env.PKG_VERSION": JSON.stringify(process.env.PKG_VERSION || pkg.version),
|
|
1202
|
+
...replacements
|
|
1203
|
+
})
|
|
1204
|
+
}
|
|
1196
1205
|
}), alias({
|
|
1197
|
-
entries:
|
|
1206
|
+
entries: {
|
|
1207
|
+
...pathAliases
|
|
1208
|
+
}
|
|
1198
1209
|
}), nodeResolve({
|
|
1199
1210
|
browser: runtime === "browser",
|
|
1200
1211
|
extensions: [".cjs", ".mjs", ".js", ".jsx", ".json", ".node"],
|
|
@@ -1211,9 +1222,9 @@ function resolveRollupConfig(ctx, buildTask) {
|
|
|
1211
1222
|
tsconfig: ctx.ts.configPath || "tsconfig.json"
|
|
1212
1223
|
}), getBabelOutputPlugin({
|
|
1213
1224
|
babelrc: false,
|
|
1214
|
-
plugins: ["@babel/plugin-proposal-object-rest-spread"],
|
|
1215
1225
|
presets: [["@babel/preset-env", {
|
|
1216
|
-
targets: pkg.browserslist || DEFAULT_BROWSERSLIST_QUERY
|
|
1226
|
+
targets: pkg.browserslist || DEFAULT_BROWSERSLIST_QUERY,
|
|
1227
|
+
modules: false
|
|
1217
1228
|
}]]
|
|
1218
1229
|
}), minify && terser({
|
|
1219
1230
|
compress: {
|
|
@@ -1254,9 +1265,10 @@ function resolveRollupConfig(ctx, buildTask) {
|
|
|
1254
1265
|
return false;
|
|
1255
1266
|
},
|
|
1256
1267
|
input: entries.reduce((acc, entry) => {
|
|
1257
|
-
return
|
|
1268
|
+
return {
|
|
1269
|
+
...acc,
|
|
1258
1270
|
[entry.name]: entry.source
|
|
1259
|
-
}
|
|
1271
|
+
};
|
|
1260
1272
|
}, {}),
|
|
1261
1273
|
plugins,
|
|
1262
1274
|
treeshake: {
|
|
@@ -1284,7 +1296,8 @@ function resolveRollupConfig(ctx, buildTask) {
|
|
|
1284
1296
|
format,
|
|
1285
1297
|
interop: "compat",
|
|
1286
1298
|
minifyInternalExports: minify,
|
|
1287
|
-
sourcemap: (_ref11 = config == null ? void 0 : config.sourcemap) !== null && _ref11 !== void 0 ? _ref11 : true
|
|
1299
|
+
sourcemap: (_ref11 = config == null ? void 0 : config.sourcemap) !== null && _ref11 !== void 0 ? _ref11 : true,
|
|
1300
|
+
hoistTransitiveImports: false
|
|
1288
1301
|
}
|
|
1289
1302
|
};
|
|
1290
1303
|
}
|
|
@@ -1340,7 +1353,8 @@ async function execPromise(ctx, task) {
|
|
|
1340
1353
|
inputOptions,
|
|
1341
1354
|
outputOptions
|
|
1342
1355
|
} = resolveRollupConfig(ctx, task);
|
|
1343
|
-
const bundle = await rollup(
|
|
1356
|
+
const bundle = await rollup({
|
|
1357
|
+
...inputOptions,
|
|
1344
1358
|
onwarn(warning) {
|
|
1345
1359
|
consoleSpy.messages.push({
|
|
1346
1360
|
type: "warn",
|
|
@@ -1348,7 +1362,7 @@ async function execPromise(ctx, task) {
|
|
|
1348
1362
|
args: [warning.message]
|
|
1349
1363
|
});
|
|
1350
1364
|
}
|
|
1351
|
-
})
|
|
1365
|
+
});
|
|
1352
1366
|
const {
|
|
1353
1367
|
output
|
|
1354
1368
|
} = await bundle.generate(outputOptions);
|
|
@@ -1381,9 +1395,10 @@ const rollupWatchTask = {
|
|
|
1381
1395
|
outputOptions
|
|
1382
1396
|
} = resolveRollupConfig(ctx, task);
|
|
1383
1397
|
return new Observable(observer => {
|
|
1384
|
-
const watchOptions =
|
|
1398
|
+
const watchOptions = {
|
|
1399
|
+
...inputOptions,
|
|
1385
1400
|
output: outputOptions
|
|
1386
|
-
}
|
|
1401
|
+
};
|
|
1387
1402
|
const watcher = watch$1(watchOptions);
|
|
1388
1403
|
watcher.on("event", event => {
|
|
1389
1404
|
observer.next(event);
|
|
@@ -1712,9 +1727,10 @@ function resolveWatchTasks(ctx) {
|
|
|
1712
1727
|
const tasks = [];
|
|
1713
1728
|
const exports = Object.entries(ctx.exports || {}).map(_ref17 => {
|
|
1714
1729
|
let [_path, exp] = _ref17;
|
|
1715
|
-
return
|
|
1716
|
-
_path
|
|
1717
|
-
|
|
1730
|
+
return {
|
|
1731
|
+
_path,
|
|
1732
|
+
...exp
|
|
1733
|
+
};
|
|
1718
1734
|
});
|
|
1719
1735
|
const dtsTask = {
|
|
1720
1736
|
type: "watch:dts",
|