powerlines 0.19.4 → 0.20.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/api.cjs +2 -2
- package/dist/api.d.cts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +1 -1
- package/dist/astro.cjs +8 -8
- package/dist/astro.d.cts +1 -1
- package/dist/astro.d.ts +1 -1
- package/dist/astro.js +5 -5
- package/dist/{chunk-JPWBN72J.js → chunk-24AZZCCW.js} +1 -1
- package/dist/{chunk-HI3LNK6Q.js → chunk-2KGMZZ36.js} +1 -1
- package/dist/{chunk-BHPTTRBA.js → chunk-2QGVOWKM.js} +16 -11
- package/dist/{chunk-AEJIVPUZ.js → chunk-4KCSCJ6E.js} +1 -1
- package/dist/{chunk-ULFJBFI7.cjs → chunk-6UVRB3IN.cjs} +3 -3
- package/dist/{chunk-RR7EC4RF.js → chunk-A2EZ3M22.js} +1 -1
- package/dist/{chunk-ZOUGUAQY.cjs → chunk-CTSV5JAF.cjs} +18 -13
- package/dist/{chunk-GFINPIIK.js → chunk-F4TS44KB.js} +3 -4
- package/dist/{chunk-I4LLZ5BI.js → chunk-FBMQTOMN.js} +1 -1
- package/dist/{chunk-PAJB5K7A.js → chunk-FYKDALJL.js} +3 -2
- package/dist/{chunk-MCDMY6GK.cjs → chunk-IHWRGHX6.cjs} +2 -2
- package/dist/{chunk-7HKTQSUG.cjs → chunk-IMMNZSFZ.cjs} +4 -3
- package/dist/{chunk-VICSRRKQ.js → chunk-JKF342AW.js} +2 -2
- package/dist/{chunk-LIXKMZW5.cjs → chunk-KL7HP7JM.cjs} +2 -2
- package/dist/{chunk-5PRY6OJM.cjs → chunk-LM6YBGC6.cjs} +2 -2
- package/dist/{chunk-KMELWYHW.cjs → chunk-MOH4CWHN.cjs} +3 -4
- package/dist/{chunk-YQZXG4X6.cjs → chunk-MZQXGWUK.cjs} +2 -2
- package/dist/{chunk-BSGWY4AP.cjs → chunk-OQNYDN5F.cjs} +2 -2
- package/dist/{chunk-X5LPEBDE.cjs → chunk-P3BP6LXC.cjs} +2 -2
- package/dist/{chunk-HEG6IAVR.js → chunk-QH3M5FBF.js} +1 -1
- package/dist/chunk-SECEPZQ3.cjs +32 -0
- package/dist/{chunk-GQM2JCO3.js → chunk-SIEHJFKB.js} +2 -2
- package/dist/{chunk-TK6CN2KT.cjs → chunk-T4AJOD6A.cjs} +4 -4
- package/dist/chunk-TY3QAXEY.js +105 -0
- package/dist/{chunk-OJSRHKHW.js → chunk-VSZXQLMI.js} +1 -1
- package/dist/{chunk-A3FMGMBV.cjs → chunk-VVFIZVYE.cjs} +2 -2
- package/dist/{chunk-Z63SQZUB.cjs → chunk-VXF37DA2.cjs} +4 -4
- package/dist/chunk-WE7PLY4H.cjs +111 -0
- package/dist/{chunk-MLAYLHZO.js → chunk-WRP6ANCC.js} +1 -1
- package/dist/chunk-XBS3AHAK.js +29 -0
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/esbuild.cjs +7 -7
- package/dist/esbuild.d.cts +1 -1
- package/dist/esbuild.d.ts +1 -1
- package/dist/esbuild.js +4 -4
- package/dist/farm.cjs +3 -3
- package/dist/farm.d.cts +1 -1
- package/dist/farm.d.ts +1 -1
- package/dist/farm.js +2 -2
- package/dist/{hooks-Bq2jUAKs.d.ts → hooks-BBZyf9CN.d.ts} +1 -1
- package/dist/{hooks-C6t50M6a.d.cts → hooks-CUxY7WKY.d.cts} +1 -1
- package/dist/index.cjs +18 -18
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -16
- package/dist/lib/build/esbuild.cjs +4 -4
- package/dist/lib/build/esbuild.d.cts +3 -3
- package/dist/lib/build/esbuild.d.ts +3 -3
- package/dist/lib/build/esbuild.js +1 -1
- package/dist/lib/build/index.cjs +33 -33
- package/dist/lib/build/index.d.cts +3 -3
- package/dist/lib/build/index.d.ts +3 -3
- package/dist/lib/build/index.js +8 -8
- package/dist/lib/build/rolldown.cjs +3 -3
- package/dist/lib/build/rolldown.d.cts +1 -1
- package/dist/lib/build/rolldown.d.ts +1 -1
- package/dist/lib/build/rolldown.js +2 -2
- package/dist/lib/build/rollup.cjs +3 -3
- package/dist/lib/build/rollup.d.cts +1 -1
- package/dist/lib/build/rollup.d.ts +1 -1
- package/dist/lib/build/rollup.js +1 -1
- package/dist/lib/build/rspack.cjs +2 -2
- package/dist/lib/build/rspack.d.cts +1 -1
- package/dist/lib/build/rspack.d.ts +1 -1
- package/dist/lib/build/rspack.js +1 -1
- package/dist/lib/build/tsup.cjs +5 -5
- package/dist/lib/build/tsup.d.cts +1 -1
- package/dist/lib/build/tsup.d.ts +1 -1
- package/dist/lib/build/tsup.js +2 -2
- package/dist/lib/build/unbuild.cjs +5 -5
- package/dist/lib/build/unbuild.d.cts +2 -2
- package/dist/lib/build/unbuild.d.ts +2 -2
- package/dist/lib/build/unbuild.js +2 -2
- package/dist/lib/build/vite.cjs +4 -4
- package/dist/lib/build/vite.d.cts +1 -1
- package/dist/lib/build/vite.d.ts +1 -1
- package/dist/lib/build/vite.js +2 -2
- package/dist/lib/build/webpack.cjs +2 -2
- package/dist/lib/build/webpack.d.cts +1 -1
- package/dist/lib/build/webpack.d.ts +1 -1
- package/dist/lib/build/webpack.js +1 -1
- package/dist/lib/{chunk-7OHD3BD4.js → chunk-4QRL5CNE.js} +1 -5
- package/dist/lib/{chunk-5ASXKB2V.js → chunk-4RUHX7LV.js} +1 -1
- package/dist/lib/{chunk-KXCEN6Y4.js → chunk-5SP6QZLX.js} +1 -1
- package/dist/lib/{chunk-GBICSIXP.cjs → chunk-ARCFV3IJ.cjs} +7 -8
- package/dist/lib/{chunk-5EXW3ZRC.cjs → chunk-CLV4J4L7.cjs} +26 -4
- package/dist/lib/{chunk-ADKYAHF5.js → chunk-DFRWBQQT.js} +33 -12
- package/dist/lib/{chunk-F7IDAYLH.cjs → chunk-FGYAS4NB.cjs} +1 -5
- package/dist/lib/{chunk-MVSXEH4P.cjs → chunk-H7V7EPB2.cjs} +6 -9
- package/dist/lib/{chunk-LSZT4OD3.cjs → chunk-HIY6WOU3.cjs} +3 -3
- package/dist/lib/{chunk-ESNHFT4V.cjs → chunk-IBONIIAZ.cjs} +10 -10
- package/dist/lib/{chunk-47WZIAPZ.js → chunk-IXREPTHZ.js} +5 -8
- package/dist/lib/chunk-K4FER6YK.cjs +125 -0
- package/dist/lib/{chunk-LJ4WO7TW.cjs → chunk-MWA3DWY5.cjs} +36 -13
- package/dist/lib/{chunk-YKSKJTO3.js → chunk-NU4GDWLL.js} +2 -2
- package/dist/lib/{chunk-37W2ZDLA.cjs → chunk-O36FCQM6.cjs} +2 -2
- package/dist/lib/{chunk-ET5QBFGZ.cjs → chunk-O5LNKYQV.cjs} +2 -2
- package/dist/lib/{chunk-SYHVP3OW.js → chunk-OI2V6L7D.js} +24 -4
- package/dist/lib/{chunk-JB2JJXGW.js → chunk-S5F4DE65.js} +1 -1
- package/dist/lib/{chunk-N66R6SPI.js → chunk-TTKY3DR4.js} +7 -8
- package/dist/lib/{chunk-N2EGPL2L.js → chunk-WWNNBLU7.js} +9 -9
- package/dist/lib/{chunk-AOKLB4V2.cjs → chunk-Y2BHXV33.cjs} +1 -1
- package/dist/lib/chunk-ZJNDT3GX.js +117 -0
- package/dist/lib/{config-gWvjY0K0.d.ts → config-Bag1Ft7u.d.ts} +139 -53
- package/dist/lib/{config-B8PZKdIr.d.cts → config-DN8Ad0lv.d.cts} +139 -53
- package/dist/lib/config-file.d.cts +1 -1
- package/dist/lib/config-file.d.ts +1 -1
- package/dist/lib/create-program.d.cts +1 -1
- package/dist/lib/create-program.d.ts +1 -1
- package/dist/lib/entry.d.cts +1 -1
- package/dist/lib/entry.d.ts +1 -1
- package/dist/lib/{hooks-BL4stJLn.d.ts → hooks-BVnPAWgt.d.ts} +1 -1
- package/dist/lib/{hooks-DnWcaiLo.d.cts → hooks-H2P-7xA4.d.cts} +1 -1
- package/dist/lib/index.cjs +95 -95
- package/dist/lib/index.d.cts +2 -2
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.js +15 -15
- package/dist/lib/logger.d.cts +1 -1
- package/dist/lib/logger.d.ts +1 -1
- package/dist/lib/typescript/compiler-host.d.cts +1 -1
- package/dist/lib/typescript/compiler-host.d.ts +1 -1
- package/dist/lib/typescript/import-transformer.d.cts +1 -1
- package/dist/lib/typescript/import-transformer.d.ts +1 -1
- package/dist/lib/typescript/index.d.cts +1 -1
- package/dist/lib/typescript/index.d.ts +1 -1
- package/dist/lib/typescript/program.d.cts +1 -1
- package/dist/lib/typescript/program.d.ts +1 -1
- package/dist/lib/unplugin/factory.cjs +6 -6
- package/dist/lib/unplugin/factory.d.cts +2 -2
- package/dist/lib/unplugin/factory.d.ts +2 -2
- package/dist/lib/unplugin/factory.js +5 -5
- package/dist/lib/unplugin/index.cjs +10 -10
- package/dist/lib/unplugin/index.d.cts +2 -2
- package/dist/lib/unplugin/index.d.ts +2 -2
- package/dist/lib/unplugin/index.js +6 -6
- package/dist/lib/unplugin/plugin.cjs +3 -3
- package/dist/lib/unplugin/plugin.d.cts +1 -1
- package/dist/lib/unplugin/plugin.d.ts +1 -1
- package/dist/lib/unplugin/plugin.js +2 -2
- package/dist/lib/unplugin/resolve-id.d.cts +1 -1
- package/dist/lib/unplugin/resolve-id.d.ts +1 -1
- package/dist/lib/utilities/bundle.cjs +3 -3
- package/dist/lib/utilities/bundle.d.cts +1 -1
- package/dist/lib/utilities/bundle.d.ts +1 -1
- package/dist/lib/utilities/bundle.js +2 -2
- package/dist/lib/utilities/cache.d.cts +1 -1
- package/dist/lib/utilities/cache.d.ts +1 -1
- package/dist/lib/utilities/file-header.d.cts +1 -1
- package/dist/lib/utilities/file-header.d.ts +1 -1
- package/dist/lib/utilities/index.cjs +29 -29
- package/dist/lib/utilities/index.d.cts +1 -1
- package/dist/lib/utilities/index.d.ts +1 -1
- package/dist/lib/utilities/index.js +7 -7
- package/dist/lib/utilities/meta.d.cts +1 -1
- package/dist/lib/utilities/meta.d.ts +1 -1
- package/dist/lib/utilities/resolve-path.d.cts +1 -1
- package/dist/lib/utilities/resolve-path.d.ts +1 -1
- package/dist/lib/utilities/resolve.cjs +4 -4
- package/dist/lib/utilities/resolve.d.cts +1 -1
- package/dist/lib/utilities/resolve.d.ts +1 -1
- package/dist/lib/utilities/resolve.js +3 -3
- package/dist/lib/utilities/source-file.d.cts +1 -1
- package/dist/lib/utilities/source-file.d.ts +1 -1
- package/dist/lib/utilities/source-map.d.cts +1 -1
- package/dist/lib/utilities/source-map.d.ts +1 -1
- package/dist/lib/utilities/worker.d.cts +1 -1
- package/dist/lib/utilities/worker.d.ts +1 -1
- package/dist/lib/utilities/write-file.d.cts +1 -1
- package/dist/lib/utilities/write-file.d.ts +1 -1
- package/dist/next.cjs +7 -7
- package/dist/next.js +4 -4
- package/dist/nuxt.cjs +9 -9
- package/dist/nuxt.js +6 -6
- package/dist/plugin-utils/chunk-J33TXWF6.js +12 -0
- package/dist/plugin-utils/chunk-QP6OJWFG.cjs +14 -0
- package/dist/plugin-utils/{config-48EWGWXq.d.cts → config-pwKiZvzJ.d.cts} +138 -52
- package/dist/plugin-utils/{config-48EWGWXq.d.ts → config-pwKiZvzJ.d.ts} +138 -52
- package/dist/plugin-utils/enforce.d.cts +1 -1
- package/dist/plugin-utils/enforce.d.ts +1 -1
- package/dist/plugin-utils/extend.d.cts +1 -1
- package/dist/plugin-utils/extend.d.ts +1 -1
- package/dist/plugin-utils/get-config-path.d.cts +2 -2
- package/dist/plugin-utils/get-config-path.d.ts +2 -2
- package/dist/plugin-utils/helpers.d.cts +3 -3
- package/dist/plugin-utils/helpers.d.ts +3 -3
- package/dist/plugin-utils/index.cjs +2 -2
- package/dist/plugin-utils/index.d.cts +1 -1
- package/dist/plugin-utils/index.d.ts +1 -1
- package/dist/plugin-utils/index.js +1 -1
- package/dist/plugin-utils/merge.d.cts +1 -1
- package/dist/plugin-utils/merge.d.ts +1 -1
- package/dist/plugin-utils/paths.cjs +2 -2
- package/dist/plugin-utils/paths.d.cts +3 -2
- package/dist/plugin-utils/paths.d.ts +3 -2
- package/dist/plugin-utils/paths.js +1 -1
- package/dist/{resolved-J7a2Aeuk.d.ts → resolved-Sxyrlt6g.d.ts} +68 -52
- package/dist/{resolved-B41SbjnS.d.cts → resolved-ohMN-3VJ.d.cts} +68 -52
- package/dist/rolldown.cjs +6 -6
- package/dist/rolldown.d.cts +1 -1
- package/dist/rolldown.d.ts +1 -1
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +6 -6
- package/dist/rollup.d.cts +1 -1
- package/dist/rollup.d.ts +1 -1
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +6 -6
- package/dist/rspack.d.cts +1 -1
- package/dist/rspack.d.ts +1 -1
- package/dist/rspack.js +3 -3
- package/dist/tsup.cjs +8 -8
- package/dist/tsup.js +5 -5
- package/dist/types/babel.d.cts +1 -1
- package/dist/types/babel.d.ts +1 -1
- package/dist/types/build.d.cts +76 -6
- package/dist/types/build.d.ts +76 -6
- package/dist/types/commands.d.cts +1 -1
- package/dist/types/commands.d.ts +1 -1
- package/dist/types/config.d.cts +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/context.d.cts +2 -2
- package/dist/types/context.d.ts +2 -2
- package/dist/types/hooks.d.cts +1 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/internal.d.cts +2 -2
- package/dist/types/internal.d.ts +2 -2
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/resolved.d.cts +1 -1
- package/dist/types/resolved.d.ts +1 -1
- package/dist/types/unplugin.d.cts +1 -1
- package/dist/types/unplugin.d.ts +1 -1
- package/dist/unloader.cjs +6 -6
- package/dist/unloader.d.cts +3 -3
- package/dist/unloader.d.ts +3 -3
- package/dist/unloader.js +3 -3
- package/dist/unplugin.cjs +18 -18
- package/dist/unplugin.d.cts +4 -4
- package/dist/unplugin.d.ts +4 -4
- package/dist/unplugin.js +15 -15
- package/dist/vite.cjs +7 -7
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +4 -4
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.d.cts +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +3 -3
- package/package.json +14 -12
- package/dist/chunk-CWCEYGLM.js +0 -43
- package/dist/chunk-F5NKLRZD.cjs +0 -49
- package/dist/chunk-RDMLGFIT.js +0 -29
- package/dist/chunk-XDLLDHRY.cjs +0 -32
- package/dist/lib/chunk-POOHWK7C.cjs +0 -63
- package/dist/lib/chunk-VLHOYZG2.js +0 -55
- package/dist/plugin-utils/chunk-2HFS2OOG.cjs +0 -14
- package/dist/plugin-utils/chunk-CVZA2RT3.js +0 -12
- package/dist/lib/{chunk-QJZZF22Y.js → chunk-7Y5MJRWF.js} +1 -1
- package/dist/lib/{chunk-MLILHOLG.cjs → chunk-UDJ37BEE.cjs} +1 -1
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
4
4
|
var alias = require('@rollup/plugin-alias');
|
|
5
5
|
var pluginBabel = require('@rollup/plugin-babel');
|
|
6
|
+
var inject = require('@rollup/plugin-inject');
|
|
6
7
|
var resolve = require('@rollup/plugin-node-resolve');
|
|
8
|
+
var replace = require('@rollup/plugin-replace');
|
|
7
9
|
var toArray = require('@stryke/convert/to-array');
|
|
8
10
|
var joinPaths = require('@stryke/path/join-paths');
|
|
9
11
|
var isFunction = require('@stryke/type-checks/is-function');
|
|
@@ -15,7 +17,9 @@ var typescriptPlugin = require('rollup-plugin-typescript2');
|
|
|
15
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
18
|
|
|
17
19
|
var alias__default = /*#__PURE__*/_interopDefault(alias);
|
|
20
|
+
var inject__default = /*#__PURE__*/_interopDefault(inject);
|
|
18
21
|
var resolve__default = /*#__PURE__*/_interopDefault(resolve);
|
|
22
|
+
var replace__default = /*#__PURE__*/_interopDefault(replace);
|
|
19
23
|
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
20
24
|
var typescriptPlugin__default = /*#__PURE__*/_interopDefault(typescriptPlugin);
|
|
21
25
|
|
|
@@ -43,7 +47,7 @@ function extractRollupConfig(context) {
|
|
|
43
47
|
const result = defu__default.default({
|
|
44
48
|
input: fs.globSync(toArray.toArray(context.config.entry).map((entry) => isString.isString(entry) ? entry : entry.file)).flat(),
|
|
45
49
|
external: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((source, importer, isResolved) => {
|
|
46
|
-
const externalFn = context.config.build.variant === "rollup" && context.config.override.external ? isFunction.isFunction(context.config.override.external) ? context.config.override.external : (id) => toArray.toArray(context.config.override.external).includes(id) : context.config.build.variant === "vite" && context.config.override.build?.rollupOptions?.external ? isFunction.isFunction(context.config.override.build?.rollupOptions?.external) ? context.config.override.build?.rollupOptions?.external : (id) => toArray.toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : context.config.build.variant === "rollup" && context.config.build.external ? isFunction.isFunction(context.config.build.external) ? context.config.build.external : (id) => toArray.toArray(context.config.build.external).includes(id) : context.config.build.variant === "vite" && context.config.build.build?.rollupOptions?.external ? isFunction.isFunction(context.config.build.build?.rollupOptions?.external) ? context.config.build.build?.rollupOptions?.external : (id) => toArray.toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : void 0;
|
|
50
|
+
const externalFn = context.config.build.variant === "rollup" && context.config.build.override.external ? isFunction.isFunction(context.config.build.override.external) ? context.config.build.override.external : (id) => toArray.toArray(context.config.build.override.external).includes(id) : context.config.build.variant === "vite" && context.config.build.override.build?.rollupOptions?.external ? isFunction.isFunction(context.config.build.override.build?.rollupOptions?.external) ? context.config.build.override.build?.rollupOptions?.external : (id) => toArray.toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : context.config.build.variant === "rollup" && context.config.build.external ? isFunction.isFunction(context.config.build.external) ? context.config.build.external : (id) => toArray.toArray(context.config.build.external).includes(id) : context.config.build.variant === "vite" && context.config.build.build?.rollupOptions?.external ? isFunction.isFunction(context.config.build.build?.rollupOptions?.external) ? context.config.build.build?.rollupOptions?.external : (id) => toArray.toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : void 0;
|
|
47
51
|
if (isFunction.isFunction(externalFn) && externalFn(source, importer, isResolved)) {
|
|
48
52
|
return true;
|
|
49
53
|
}
|
|
@@ -63,6 +67,16 @@ function extractRollupConfig(context) {
|
|
|
63
67
|
check: false,
|
|
64
68
|
tsconfig: context.tsconfig.tsconfigFilePath
|
|
65
69
|
}),
|
|
70
|
+
context.config.build.define && Object.keys(context.config.build.define).length > 0 && replace__default.default({
|
|
71
|
+
sourceMap: context.config.mode === "development",
|
|
72
|
+
preventAssignment: true,
|
|
73
|
+
...context.config.build.define ?? {}
|
|
74
|
+
}),
|
|
75
|
+
context.config.build.inject && Object.keys(context.config.build.inject).length > 0 && // eslint-disable-next-line ts/no-unsafe-call
|
|
76
|
+
inject__default.default({
|
|
77
|
+
sourceMap: context.config.mode === "development",
|
|
78
|
+
...context.config.build.inject
|
|
79
|
+
}),
|
|
66
80
|
alias__default.default({
|
|
67
81
|
entries: context.builtins.reduce((ret, id) => {
|
|
68
82
|
if (!ret.find((e) => e.find === id)) {
|
|
@@ -75,7 +89,15 @@ function extractRollupConfig(context) {
|
|
|
75
89
|
}
|
|
76
90
|
}
|
|
77
91
|
return ret;
|
|
78
|
-
}, [])
|
|
92
|
+
}, context.config.build.alias ? Object.entries(context.config.build.alias).reduce((ret, [id, path]) => {
|
|
93
|
+
if (!ret.find((e) => e.find === id)) {
|
|
94
|
+
ret.push({
|
|
95
|
+
find: id,
|
|
96
|
+
replacement: path
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return ret;
|
|
100
|
+
}, []) : [])
|
|
79
101
|
}),
|
|
80
102
|
pluginBabel.getBabelInputPlugin(defu__default.default(context.config.transform.babel, {
|
|
81
103
|
caller: {
|
|
@@ -101,8 +123,8 @@ function extractRollupConfig(context) {
|
|
|
101
123
|
preferBuiltins: true
|
|
102
124
|
}),
|
|
103
125
|
dtsBundlePlugin
|
|
104
|
-
]
|
|
105
|
-
}, context.config.build.variant === "rollup" ? context.config.override : {}, context.config.build.variant === "vite" ? context.config.override.build?.rollupOptions : {}, {
|
|
126
|
+
].filter(Boolean)
|
|
127
|
+
}, context.config.build.variant === "rollup" ? context.config.build.override : {}, context.config.build.variant === "vite" ? context.config.build.override.build?.rollupOptions : {}, {
|
|
106
128
|
cache: !context.config.skipCache ? joinPaths.joinPaths(context.cachePath, "rollup") : false,
|
|
107
129
|
output: {
|
|
108
130
|
dir: context.config.output.outputPath
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { dtsBundlePlugin } from './chunk-
|
|
1
|
+
import { dtsBundlePlugin } from './chunk-OI2V6L7D.js';
|
|
2
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { getBabelInputPlugin } from '@rollup/plugin-babel';
|
|
4
|
+
import inject from '@rollup/plugin-inject';
|
|
4
5
|
import resolve from '@rollup/plugin-node-resolve';
|
|
6
|
+
import replace from '@rollup/plugin-replace';
|
|
5
7
|
import { toArray } from '@stryke/convert/to-array';
|
|
6
8
|
import { joinPaths } from '@stryke/path/join-paths';
|
|
7
9
|
import { isFunction } from '@stryke/type-checks/is-function';
|
|
@@ -15,7 +17,7 @@ function extractRolldownConfig(context) {
|
|
|
15
17
|
return defu({
|
|
16
18
|
input: globSync(toArray(context.config.entry).map((entry) => isString(entry) ? entry : entry.file)).flat(),
|
|
17
19
|
external: /* @__PURE__ */ __name((source, importer, isResolved) => {
|
|
18
|
-
const externalFn = context.config.build.variant === "rollup" && context.config.override.external ? isFunction(context.config.override.external) ? context.config.override.external : (id) => toArray(context.config.override.external).includes(id) : context.config.build.variant === "vite" && context.config.override?.build?.rollupOptions?.external ? isFunction(context.config.override?.build?.rollupOptions?.external) ? context.config.override?.build?.rollupOptions?.external : (id) => toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : context.config.build.variant === "rollup" && context.config.build.external ? isFunction(context.config.build.external) ? context.config.build.external : (id) => toArray(context.config.build.external).includes(id) : context.config.build.variant === "vite" && context.config.build.build?.rollupOptions?.external ? isFunction(context.config.build.build?.rollupOptions?.external) ? context.config.build.build?.rollupOptions?.external : (id) => toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : void 0;
|
|
20
|
+
const externalFn = context.config.build.variant === "rollup" && context.config.build.override.external ? isFunction(context.config.build.override.external) ? context.config.build.override.external : (id) => toArray(context.config.build.override.external).includes(id) : context.config.build.variant === "vite" && context.config.build.override?.build?.rollupOptions?.external ? isFunction(context.config.build.override?.build?.rollupOptions?.external) ? context.config.build.override?.build?.rollupOptions?.external : (id) => toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : context.config.build.variant === "rollup" && context.config.build.external ? isFunction(context.config.build.external) ? context.config.build.external : (id) => toArray(context.config.build.external).includes(id) : context.config.build.variant === "vite" && context.config.build.build?.rollupOptions?.external ? isFunction(context.config.build.build?.rollupOptions?.external) ? context.config.build.build?.rollupOptions?.external : (id) => toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : void 0;
|
|
19
21
|
if (isFunction(externalFn) && externalFn(source, importer, isResolved)) {
|
|
20
22
|
return true;
|
|
21
23
|
}
|
|
@@ -35,6 +37,16 @@ function extractRolldownConfig(context) {
|
|
|
35
37
|
check: false,
|
|
36
38
|
tsconfig: context.tsconfig.tsconfigFilePath
|
|
37
39
|
}),
|
|
40
|
+
context.config.build.define && Object.keys(context.config.build.define).length > 0 && replace({
|
|
41
|
+
sourceMap: context.config.mode === "development",
|
|
42
|
+
preventAssignment: true,
|
|
43
|
+
...context.config.build.define ?? {}
|
|
44
|
+
}),
|
|
45
|
+
context.config.build.inject && Object.keys(context.config.build.inject).length > 0 && // eslint-disable-next-line ts/no-unsafe-call
|
|
46
|
+
inject({
|
|
47
|
+
sourceMap: context.config.mode === "development",
|
|
48
|
+
...context.config.build.inject
|
|
49
|
+
}),
|
|
38
50
|
aliasPlugin({
|
|
39
51
|
entries: context.builtins.reduce((ret, id) => {
|
|
40
52
|
if (!ret.find((e) => e.find === id)) {
|
|
@@ -47,7 +59,15 @@ function extractRolldownConfig(context) {
|
|
|
47
59
|
}
|
|
48
60
|
}
|
|
49
61
|
return ret;
|
|
50
|
-
}, [])
|
|
62
|
+
}, context.config.build.alias ? Object.entries(context.config.build.alias).reduce((ret, [id, path]) => {
|
|
63
|
+
if (!ret.find((e) => e.find === id)) {
|
|
64
|
+
ret.push({
|
|
65
|
+
find: id,
|
|
66
|
+
replacement: path
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return ret;
|
|
70
|
+
}, []) : [])
|
|
51
71
|
}),
|
|
52
72
|
getBabelInputPlugin(defu(context.config.transform.babel, {
|
|
53
73
|
caller: {
|
|
@@ -74,15 +94,15 @@ function extractRolldownConfig(context) {
|
|
|
74
94
|
}),
|
|
75
95
|
dtsBundlePlugin
|
|
76
96
|
]
|
|
77
|
-
}, context.config.build.variant === "rolldown" || context.config.build.variant === "rollup" ? context.config.override : {}, context.config.build.variant === "vite" ? context.config.override.build?.rollupOptions : {}, {
|
|
97
|
+
}, context.config.build.variant === "rolldown" || context.config.build.variant === "rollup" ? context.config.build.override : {}, context.config.build.variant === "vite" ? context.config.build.override.build?.rollupOptions : {}, {
|
|
98
|
+
experimental: {
|
|
99
|
+
viteMode: context.config.build.variant === "vite"
|
|
100
|
+
},
|
|
78
101
|
resolve: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
return ret;
|
|
85
|
-
}, {})
|
|
102
|
+
mainFields: context.config.build.mainFields,
|
|
103
|
+
conditions: context.config.build.conditions,
|
|
104
|
+
define: context.config.build.define,
|
|
105
|
+
extensions: context.config.build.extensions
|
|
86
106
|
},
|
|
87
107
|
platform: context.config.build.platform,
|
|
88
108
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
@@ -90,7 +110,8 @@ function extractRolldownConfig(context) {
|
|
|
90
110
|
output: {
|
|
91
111
|
dir: context.config.output.outputPath
|
|
92
112
|
},
|
|
93
|
-
logLevel: context.config.logLevel
|
|
113
|
+
logLevel: context.config.logLevel,
|
|
114
|
+
onLog: context.log
|
|
94
115
|
}, context.config.build.variant === "rolldown" || context.config.build.variant === "rollup" ? context.config.build : {}, context.config.build.variant === "vite" ? context.config.build.build : {}, {
|
|
95
116
|
output: {
|
|
96
117
|
sourcemap: context.config.mode === "development"
|
|
@@ -19,11 +19,7 @@ function extractWebpackConfig(context) {
|
|
|
19
19
|
return ret;
|
|
20
20
|
}, {})
|
|
21
21
|
}
|
|
22
|
-
}, context.config.build.variant === "webpack" ? context.config.override : {}, {
|
|
23
|
-
external: context.config.build.external,
|
|
24
|
-
noExternal: context.config.build.noExternal,
|
|
25
|
-
skipNodeModulesBundle: context.config.build.skipNodeModulesBundle
|
|
26
|
-
}, {
|
|
22
|
+
}, context.config.build.variant === "webpack" ? context.config.build.override : {}, {
|
|
27
23
|
output: {
|
|
28
24
|
path: joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.output.outputPath)
|
|
29
25
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkK4FER6YK_cjs = require('./chunk-K4FER6YK.cjs');
|
|
4
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var constants = require('@storm-software/tsup/constants');
|
|
6
6
|
var defu = require('defu');
|
|
@@ -28,7 +28,7 @@ var DEFAULT_TSUP_CONFIG = {
|
|
|
28
28
|
banner: {}
|
|
29
29
|
};
|
|
30
30
|
function resolveTsupEntry(context, entryPoints) {
|
|
31
|
-
return
|
|
31
|
+
return chunkK4FER6YK_cjs.resolveESBuildEntry(context, entryPoints);
|
|
32
32
|
}
|
|
33
33
|
chunkUSNT2KNT_cjs.__name(resolveTsupEntry, "resolveTsupEntry");
|
|
34
34
|
function extractTsupConfig(context) {
|
|
@@ -37,8 +37,8 @@ function extractTsupConfig(context) {
|
|
|
37
37
|
if (context.config.build.variant === "tsup") {
|
|
38
38
|
if (context.config.build.esbuildOptions) {
|
|
39
39
|
context.config.build.esbuildOptions?.(options, ctx);
|
|
40
|
-
} else if (context.config.override.esbuildOptions) {
|
|
41
|
-
context.config.override.esbuildOptions?.(options, ctx);
|
|
40
|
+
} else if (context.config.build.override.esbuildOptions) {
|
|
41
|
+
context.config.build.override.esbuildOptions?.(options, ctx);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
options.alias = {
|
|
@@ -53,19 +53,16 @@ function extractTsupConfig(context) {
|
|
|
53
53
|
};
|
|
54
54
|
}, "esbuildOptions"),
|
|
55
55
|
noExternal: context.builtins
|
|
56
|
-
}, context.config.build.variant === "tsup" ? context.config.override : {}, {
|
|
56
|
+
}, context.config.build.variant === "tsup" ? context.config.build.override : {}, {
|
|
57
57
|
name: context.config.name,
|
|
58
58
|
assets: context.config.output.assets,
|
|
59
|
-
|
|
60
|
-
noExternal: context.config.build.noExternal,
|
|
61
|
-
skipNodeModulesBundle: context.config.build.skipNodeModulesBundle,
|
|
59
|
+
resolveExtensions: context.config.build.extensions,
|
|
62
60
|
outputPath: context.config.output.outputPath,
|
|
63
61
|
projectRoot: context.config.projectRoot,
|
|
64
62
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
65
63
|
tsconfigRaw: context.tsconfig.tsconfigJson,
|
|
66
64
|
format: context.config.output.format,
|
|
67
65
|
mode: context.config.mode,
|
|
68
|
-
platform: context.config.build.platform,
|
|
69
66
|
treeshake: context.config.build.variant === "tsup" ? context.config.build?.treeshake : context.config.build.variant === "tsup" ? context.config.build?.treeShaking : void 0
|
|
70
67
|
}, context.config.build.variant === "tsup" ? context.config.build : {}, {
|
|
71
68
|
minify: context.config.mode !== "development",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var chunk5EXW3ZRC_cjs = require('./chunk-5EXW3ZRC.cjs');
|
|
4
3
|
var chunk3OCI4TH7_cjs = require('./chunk-3OCI4TH7.cjs');
|
|
4
|
+
var chunkCLV4J4L7_cjs = require('./chunk-CLV4J4L7.cjs');
|
|
5
5
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
6
6
|
var joinPaths = require('@stryke/path/join-paths');
|
|
7
7
|
var isObject = require('@stryke/type-checks/is-object');
|
|
@@ -122,7 +122,7 @@ function extractUnbuildConfig(context) {
|
|
|
122
122
|
}
|
|
123
123
|
return ret;
|
|
124
124
|
}, {})
|
|
125
|
-
}, context.config.build.variant === "unbuild" ? context.config.override : {}, {
|
|
125
|
+
}, context.config.build.variant === "unbuild" ? context.config.build.override : {}, {
|
|
126
126
|
projectName: context.config.name,
|
|
127
127
|
name: context.config.name,
|
|
128
128
|
orgName: isObject.isObject(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization,
|
|
@@ -144,7 +144,7 @@ function extractUnbuildConfig(context) {
|
|
|
144
144
|
fsCache: joinPaths.joinPaths(context.envPaths.cache, "jiti"),
|
|
145
145
|
moduleCache: true
|
|
146
146
|
},
|
|
147
|
-
rollup:
|
|
147
|
+
rollup: chunkCLV4J4L7_cjs.extractRollupConfig(context)
|
|
148
148
|
}, context.config.build.variant === "unbuild" ? context.config.build : {}, {
|
|
149
149
|
debug: context.config.mode === "development",
|
|
150
150
|
minify: context.config.mode !== "development",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkK4FER6YK_cjs = require('./chunk-K4FER6YK.cjs');
|
|
4
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var joinPaths = require('@stryke/path/join-paths');
|
|
6
6
|
var defu = require('defu');
|
|
@@ -36,13 +36,14 @@ function extractViteConfig(context) {
|
|
|
36
36
|
ret[id] = path;
|
|
37
37
|
}
|
|
38
38
|
return ret;
|
|
39
|
-
}, {})
|
|
39
|
+
}, {}),
|
|
40
|
+
dedupe: context.config.build.dedupe,
|
|
41
|
+
mainFields: context.config.build.mainFields,
|
|
42
|
+
conditions: context.config.build.conditions,
|
|
43
|
+
extensions: context.config.build.extensions
|
|
40
44
|
}
|
|
41
|
-
}, context.config.build.variant === "vite" ? context.config.override : {}, {
|
|
42
|
-
|
|
43
|
-
noExternal: context.config.build.noExternal,
|
|
44
|
-
skipNodeModulesBundle: context.config.build.skipNodeModulesBundle
|
|
45
|
-
}, {
|
|
45
|
+
}, context.config.build.variant === "vite" ? context.config.build.override : {}, {
|
|
46
|
+
define: context.config.build.define,
|
|
46
47
|
rootDir: context.config.sourceRoot,
|
|
47
48
|
platform: context.config.build.platform,
|
|
48
49
|
mode: context.config.mode === "development" ? "development" : "production",
|
|
@@ -52,10 +53,9 @@ function extractViteConfig(context) {
|
|
|
52
53
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
53
54
|
tsconfigRaw: context.tsconfig.tsconfigJson
|
|
54
55
|
},
|
|
55
|
-
esbuild:
|
|
56
|
+
esbuild: chunkK4FER6YK_cjs.extractESBuildConfig(context),
|
|
56
57
|
logLevel: context.config.logLevel ?? void 0,
|
|
57
|
-
envDir: context.config.projectRoot
|
|
58
|
-
noExternal: context.builtins
|
|
58
|
+
envDir: context.config.projectRoot
|
|
59
59
|
}, context.config.build.variant === "vite" ? context.config.build : {}, {
|
|
60
60
|
build: {
|
|
61
61
|
minify: context.config.mode !== "development",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveESBuildEntry } from './chunk-
|
|
1
|
+
import { resolveESBuildEntry } from './chunk-ZJNDT3GX.js';
|
|
2
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { DEFAULT_BUILD_OPTIONS } from '@storm-software/tsup/constants';
|
|
4
4
|
import defu from 'defu';
|
|
@@ -31,8 +31,8 @@ function extractTsupConfig(context) {
|
|
|
31
31
|
if (context.config.build.variant === "tsup") {
|
|
32
32
|
if (context.config.build.esbuildOptions) {
|
|
33
33
|
context.config.build.esbuildOptions?.(options, ctx);
|
|
34
|
-
} else if (context.config.override.esbuildOptions) {
|
|
35
|
-
context.config.override.esbuildOptions?.(options, ctx);
|
|
34
|
+
} else if (context.config.build.override.esbuildOptions) {
|
|
35
|
+
context.config.build.override.esbuildOptions?.(options, ctx);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
options.alias = {
|
|
@@ -47,19 +47,16 @@ function extractTsupConfig(context) {
|
|
|
47
47
|
};
|
|
48
48
|
}, "esbuildOptions"),
|
|
49
49
|
noExternal: context.builtins
|
|
50
|
-
}, context.config.build.variant === "tsup" ? context.config.override : {}, {
|
|
50
|
+
}, context.config.build.variant === "tsup" ? context.config.build.override : {}, {
|
|
51
51
|
name: context.config.name,
|
|
52
52
|
assets: context.config.output.assets,
|
|
53
|
-
|
|
54
|
-
noExternal: context.config.build.noExternal,
|
|
55
|
-
skipNodeModulesBundle: context.config.build.skipNodeModulesBundle,
|
|
53
|
+
resolveExtensions: context.config.build.extensions,
|
|
56
54
|
outputPath: context.config.output.outputPath,
|
|
57
55
|
projectRoot: context.config.projectRoot,
|
|
58
56
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
59
57
|
tsconfigRaw: context.tsconfig.tsconfigJson,
|
|
60
58
|
format: context.config.output.format,
|
|
61
59
|
mode: context.config.mode,
|
|
62
|
-
platform: context.config.build.platform,
|
|
63
60
|
treeshake: context.config.build.variant === "tsup" ? context.config.build?.treeshake : context.config.build.variant === "tsup" ? context.config.build?.treeShaking : void 0
|
|
64
61
|
}, context.config.build.variant === "tsup" ? context.config.build : {}, {
|
|
65
62
|
minify: context.config.mode !== "development",
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkOTBLE55Z_cjs = require('./chunk-OTBLE55Z.cjs');
|
|
4
|
+
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
|
+
var omit = require('@stryke/helpers/omit');
|
|
6
|
+
var joinPaths = require('@stryke/path/join-paths');
|
|
7
|
+
var replace = require('@stryke/path/replace');
|
|
8
|
+
var camelCase = require('@stryke/string-format/camel-case');
|
|
9
|
+
var isString = require('@stryke/type-checks/is-string');
|
|
10
|
+
var defu = require('defu');
|
|
11
|
+
|
|
12
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
15
|
+
|
|
16
|
+
var DEFAULT_ESBUILD_CONFIG = {
|
|
17
|
+
target: "esnext",
|
|
18
|
+
platform: "neutral",
|
|
19
|
+
format: "esm",
|
|
20
|
+
write: true,
|
|
21
|
+
minify: true,
|
|
22
|
+
sourcemap: false,
|
|
23
|
+
bundle: true,
|
|
24
|
+
treeShaking: true,
|
|
25
|
+
keepNames: true,
|
|
26
|
+
splitting: true,
|
|
27
|
+
logLevel: "silent"
|
|
28
|
+
};
|
|
29
|
+
function resolveESBuildEntry(context, entryPoints = []) {
|
|
30
|
+
return entryPoints.reduce((ret, entry) => {
|
|
31
|
+
if (isString.isString(entry)) {
|
|
32
|
+
ret[replace.replaceExtension(replace.replacePath(entry, context.config.sourceRoot || context.config.projectRoot))] = replace.replacePath(entry, context.config.sourceRoot || context.config.projectRoot);
|
|
33
|
+
} else {
|
|
34
|
+
ret[entry.output || chunkOTBLE55Z_cjs.resolveEntryOutput(context, entry.input || entry)] = chunkOTBLE55Z_cjs.resolveEntryInputFile(context, entry.input || entry);
|
|
35
|
+
}
|
|
36
|
+
return ret;
|
|
37
|
+
}, {});
|
|
38
|
+
}
|
|
39
|
+
chunkUSNT2KNT_cjs.__name(resolveESBuildEntry, "resolveESBuildEntry");
|
|
40
|
+
function extractESBuildConfig(context) {
|
|
41
|
+
const inject = context.config.build.override.inject ?? context.config.build.inject;
|
|
42
|
+
if (inject && Object.keys(inject).length > 0) {
|
|
43
|
+
context.fs.writeFileSync(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
|
|
44
|
+
if (value) {
|
|
45
|
+
if (Array.isArray(value)) {
|
|
46
|
+
if (camelCase.camelCase(key) !== key) {
|
|
47
|
+
if (value.length === 1) {
|
|
48
|
+
return `
|
|
49
|
+
import ${camelCase.camelCase(key)} from "${value[0]}";
|
|
50
|
+
export { ${camelCase.camelCase(key)} as "${key}" }`;
|
|
51
|
+
} else if (value.length > 1) {
|
|
52
|
+
return `
|
|
53
|
+
import ${value[1] === "*" ? `* as ${camelCase.camelCase(key)}` : `{ ${value[1]} as ${camelCase.camelCase(key)} }`} from "${value[0]}";
|
|
54
|
+
export { ${camelCase.camelCase(key)} as "${key}" }`;
|
|
55
|
+
}
|
|
56
|
+
} else if (value.length === 1) {
|
|
57
|
+
return `
|
|
58
|
+
import ${key} from "${value[0]}";
|
|
59
|
+
export { ${key} };`;
|
|
60
|
+
} else if (value.length > 1) {
|
|
61
|
+
return `
|
|
62
|
+
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
63
|
+
export { ${key} };`;
|
|
64
|
+
}
|
|
65
|
+
} else if (camelCase.camelCase(key) !== key) {
|
|
66
|
+
return `
|
|
67
|
+
import ${camelCase.camelCase(key)} from "${value[0]}";
|
|
68
|
+
export { ${camelCase.camelCase(key)} as "${key}" }`;
|
|
69
|
+
} else {
|
|
70
|
+
return `
|
|
71
|
+
import ${key} from "${value}";
|
|
72
|
+
export { ${key} };`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return "";
|
|
76
|
+
}).join("\n"));
|
|
77
|
+
}
|
|
78
|
+
return defu__default.default({
|
|
79
|
+
alias: context.builtins.reduce((ret, id) => {
|
|
80
|
+
const path = context.fs.ids[id];
|
|
81
|
+
if (path) {
|
|
82
|
+
ret[id] = path;
|
|
83
|
+
}
|
|
84
|
+
return ret;
|
|
85
|
+
}, context.config.build.override.alias ?? context.config.build.alias ?? {}),
|
|
86
|
+
inject: inject && Object.keys(inject).length > 0 ? [
|
|
87
|
+
joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")
|
|
88
|
+
] : void 0
|
|
89
|
+
}, context.config.build.variant === "esbuild" ? omit.omit(context.config.build.override, [
|
|
90
|
+
"alias",
|
|
91
|
+
"inject",
|
|
92
|
+
"external",
|
|
93
|
+
"noExternal",
|
|
94
|
+
"skipNodeModulesBundle",
|
|
95
|
+
"extensions"
|
|
96
|
+
]) : {}, {
|
|
97
|
+
mainFields: context.config.build.mainFields,
|
|
98
|
+
conditions: context.config.build.conditions,
|
|
99
|
+
define: context.config.build.define,
|
|
100
|
+
resolveExtensions: context.config.build.extensions,
|
|
101
|
+
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
102
|
+
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
103
|
+
platform: context.config.build.platform,
|
|
104
|
+
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
105
|
+
outdir: context.config.output.outputPath,
|
|
106
|
+
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
107
|
+
tsconfigRaw: context.tsconfig.tsconfigJson
|
|
108
|
+
}, context.config.build.variant === "esbuild" ? omit.omit(context.config.build, [
|
|
109
|
+
"alias",
|
|
110
|
+
"inject",
|
|
111
|
+
"external",
|
|
112
|
+
"noExternal",
|
|
113
|
+
"skipNodeModulesBundle",
|
|
114
|
+
"extensions"
|
|
115
|
+
]) : {}, {
|
|
116
|
+
minify: context.config.mode !== "development",
|
|
117
|
+
metafile: context.config.mode === "development",
|
|
118
|
+
sourcemap: context.config.mode === "development"
|
|
119
|
+
}, DEFAULT_ESBUILD_CONFIG);
|
|
120
|
+
}
|
|
121
|
+
chunkUSNT2KNT_cjs.__name(extractESBuildConfig, "extractESBuildConfig");
|
|
122
|
+
|
|
123
|
+
exports.DEFAULT_ESBUILD_CONFIG = DEFAULT_ESBUILD_CONFIG;
|
|
124
|
+
exports.extractESBuildConfig = extractESBuildConfig;
|
|
125
|
+
exports.resolveESBuildEntry = resolveESBuildEntry;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCLV4J4L7_cjs = require('./chunk-CLV4J4L7.cjs');
|
|
4
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var pluginBabel = require('@rollup/plugin-babel');
|
|
6
|
+
var inject = require('@rollup/plugin-inject');
|
|
6
7
|
var resolve = require('@rollup/plugin-node-resolve');
|
|
8
|
+
var replace = require('@rollup/plugin-replace');
|
|
7
9
|
var toArray = require('@stryke/convert/to-array');
|
|
8
10
|
var joinPaths = require('@stryke/path/join-paths');
|
|
9
11
|
var isFunction = require('@stryke/type-checks/is-function');
|
|
@@ -15,7 +17,9 @@ var typescriptPlugin = require('rollup-plugin-typescript2');
|
|
|
15
17
|
|
|
16
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
19
|
|
|
20
|
+
var inject__default = /*#__PURE__*/_interopDefault(inject);
|
|
18
21
|
var resolve__default = /*#__PURE__*/_interopDefault(resolve);
|
|
22
|
+
var replace__default = /*#__PURE__*/_interopDefault(replace);
|
|
19
23
|
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
20
24
|
var typescriptPlugin__default = /*#__PURE__*/_interopDefault(typescriptPlugin);
|
|
21
25
|
|
|
@@ -23,7 +27,7 @@ function extractRolldownConfig(context) {
|
|
|
23
27
|
return defu__default.default({
|
|
24
28
|
input: fs.globSync(toArray.toArray(context.config.entry).map((entry) => isString.isString(entry) ? entry : entry.file)).flat(),
|
|
25
29
|
external: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((source, importer, isResolved) => {
|
|
26
|
-
const externalFn = context.config.build.variant === "rollup" && context.config.override.external ? isFunction.isFunction(context.config.override.external) ? context.config.override.external : (id) => toArray.toArray(context.config.override.external).includes(id) : context.config.build.variant === "vite" && context.config.override?.build?.rollupOptions?.external ? isFunction.isFunction(context.config.override?.build?.rollupOptions?.external) ? context.config.override?.build?.rollupOptions?.external : (id) => toArray.toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : context.config.build.variant === "rollup" && context.config.build.external ? isFunction.isFunction(context.config.build.external) ? context.config.build.external : (id) => toArray.toArray(context.config.build.external).includes(id) : context.config.build.variant === "vite" && context.config.build.build?.rollupOptions?.external ? isFunction.isFunction(context.config.build.build?.rollupOptions?.external) ? context.config.build.build?.rollupOptions?.external : (id) => toArray.toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : void 0;
|
|
30
|
+
const externalFn = context.config.build.variant === "rollup" && context.config.build.override.external ? isFunction.isFunction(context.config.build.override.external) ? context.config.build.override.external : (id) => toArray.toArray(context.config.build.override.external).includes(id) : context.config.build.variant === "vite" && context.config.build.override?.build?.rollupOptions?.external ? isFunction.isFunction(context.config.build.override?.build?.rollupOptions?.external) ? context.config.build.override?.build?.rollupOptions?.external : (id) => toArray.toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : context.config.build.variant === "rollup" && context.config.build.external ? isFunction.isFunction(context.config.build.external) ? context.config.build.external : (id) => toArray.toArray(context.config.build.external).includes(id) : context.config.build.variant === "vite" && context.config.build.build?.rollupOptions?.external ? isFunction.isFunction(context.config.build.build?.rollupOptions?.external) ? context.config.build.build?.rollupOptions?.external : (id) => toArray.toArray(context.config.build?.build?.rollupOptions?.external).includes(id) : void 0;
|
|
27
31
|
if (isFunction.isFunction(externalFn) && externalFn(source, importer, isResolved)) {
|
|
28
32
|
return true;
|
|
29
33
|
}
|
|
@@ -43,6 +47,16 @@ function extractRolldownConfig(context) {
|
|
|
43
47
|
check: false,
|
|
44
48
|
tsconfig: context.tsconfig.tsconfigFilePath
|
|
45
49
|
}),
|
|
50
|
+
context.config.build.define && Object.keys(context.config.build.define).length > 0 && replace__default.default({
|
|
51
|
+
sourceMap: context.config.mode === "development",
|
|
52
|
+
preventAssignment: true,
|
|
53
|
+
...context.config.build.define ?? {}
|
|
54
|
+
}),
|
|
55
|
+
context.config.build.inject && Object.keys(context.config.build.inject).length > 0 && // eslint-disable-next-line ts/no-unsafe-call
|
|
56
|
+
inject__default.default({
|
|
57
|
+
sourceMap: context.config.mode === "development",
|
|
58
|
+
...context.config.build.inject
|
|
59
|
+
}),
|
|
46
60
|
experimental.aliasPlugin({
|
|
47
61
|
entries: context.builtins.reduce((ret, id) => {
|
|
48
62
|
if (!ret.find((e) => e.find === id)) {
|
|
@@ -55,7 +69,15 @@ function extractRolldownConfig(context) {
|
|
|
55
69
|
}
|
|
56
70
|
}
|
|
57
71
|
return ret;
|
|
58
|
-
}, [])
|
|
72
|
+
}, context.config.build.alias ? Object.entries(context.config.build.alias).reduce((ret, [id, path]) => {
|
|
73
|
+
if (!ret.find((e) => e.find === id)) {
|
|
74
|
+
ret.push({
|
|
75
|
+
find: id,
|
|
76
|
+
replacement: path
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return ret;
|
|
80
|
+
}, []) : [])
|
|
59
81
|
}),
|
|
60
82
|
pluginBabel.getBabelInputPlugin(defu__default.default(context.config.transform.babel, {
|
|
61
83
|
caller: {
|
|
@@ -80,17 +102,17 @@ function extractRolldownConfig(context) {
|
|
|
80
102
|
],
|
|
81
103
|
preferBuiltins: true
|
|
82
104
|
}),
|
|
83
|
-
|
|
105
|
+
chunkCLV4J4L7_cjs.dtsBundlePlugin
|
|
84
106
|
]
|
|
85
|
-
}, context.config.build.variant === "rolldown" || context.config.build.variant === "rollup" ? context.config.override : {}, context.config.build.variant === "vite" ? context.config.override.build?.rollupOptions : {}, {
|
|
107
|
+
}, context.config.build.variant === "rolldown" || context.config.build.variant === "rollup" ? context.config.build.override : {}, context.config.build.variant === "vite" ? context.config.build.override.build?.rollupOptions : {}, {
|
|
108
|
+
experimental: {
|
|
109
|
+
viteMode: context.config.build.variant === "vite"
|
|
110
|
+
},
|
|
86
111
|
resolve: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
return ret;
|
|
93
|
-
}, {})
|
|
112
|
+
mainFields: context.config.build.mainFields,
|
|
113
|
+
conditions: context.config.build.conditions,
|
|
114
|
+
define: context.config.build.define,
|
|
115
|
+
extensions: context.config.build.extensions
|
|
94
116
|
},
|
|
95
117
|
platform: context.config.build.platform,
|
|
96
118
|
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
@@ -98,7 +120,8 @@ function extractRolldownConfig(context) {
|
|
|
98
120
|
output: {
|
|
99
121
|
dir: context.config.output.outputPath
|
|
100
122
|
},
|
|
101
|
-
logLevel: context.config.logLevel
|
|
123
|
+
logLevel: context.config.logLevel,
|
|
124
|
+
onLog: context.log
|
|
102
125
|
}, context.config.build.variant === "rolldown" || context.config.build.variant === "rollup" ? context.config.build : {}, context.config.build.variant === "vite" ? context.config.build.build : {}, {
|
|
103
126
|
output: {
|
|
104
127
|
sourcemap: context.config.mode === "development"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { extractRollupConfig } from './chunk-SYHVP3OW.js';
|
|
2
1
|
import { getString } from './chunk-M263EZ4F.js';
|
|
2
|
+
import { extractRollupConfig } from './chunk-OI2V6L7D.js';
|
|
3
3
|
import { __name } from './chunk-SHUYVCID.js';
|
|
4
4
|
import { joinPaths } from '@stryke/path/join-paths';
|
|
5
5
|
import { isObject } from '@stryke/type-checks/is-object';
|
|
@@ -116,7 +116,7 @@ function extractUnbuildConfig(context) {
|
|
|
116
116
|
}
|
|
117
117
|
return ret;
|
|
118
118
|
}, {})
|
|
119
|
-
}, context.config.build.variant === "unbuild" ? context.config.override : {}, {
|
|
119
|
+
}, context.config.build.variant === "unbuild" ? context.config.build.override : {}, {
|
|
120
120
|
projectName: context.config.name,
|
|
121
121
|
name: context.config.name,
|
|
122
122
|
orgName: isObject(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkO5LNKYQV_cjs = require('./chunk-O5LNKYQV.cjs');
|
|
4
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var parseTypeDefinition = require('@stryke/convert/parse-type-definition');
|
|
6
6
|
var isSetString = require('@stryke/type-checks/is-set-string');
|
|
@@ -12,7 +12,7 @@ async function resolve(context, type, overrides = {}) {
|
|
|
12
12
|
} else {
|
|
13
13
|
typeDefinition = type;
|
|
14
14
|
}
|
|
15
|
-
const result = await
|
|
15
|
+
const result = await chunkO5LNKYQV_cjs.bundle(context, typeDefinition.file, overrides);
|
|
16
16
|
const resolved = await context.resolver.evalModule(result.text, {
|
|
17
17
|
filename: result.path,
|
|
18
18
|
forceTranspile: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkMZJWK36Q_cjs = require('./chunk-MZJWK36Q.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkK4FER6YK_cjs = require('./chunk-K4FER6YK.cjs');
|
|
5
5
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
6
6
|
var types = require('@storm-software/config-tools/types');
|
|
7
7
|
var esbuild = require('esbuild');
|
|
@@ -12,7 +12,7 @@ async function bundle(context, file, overrides = {}) {
|
|
|
12
12
|
throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
13
13
|
}
|
|
14
14
|
const result = await esbuild.build({
|
|
15
|
-
...
|
|
15
|
+
...chunkK4FER6YK_cjs.extractESBuildConfig(context),
|
|
16
16
|
entry: [
|
|
17
17
|
path
|
|
18
18
|
],
|