@visulima/packem-rollup 1.0.0-alpha.65 → 1.0.0-alpha.67
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/CHANGELOG.md +27 -0
- package/LICENSE.md +9 -534
- package/dist/index.d.ts +680 -25
- package/dist/index.js +1 -1
- package/dist/packem_shared/browserslistToEsbuild-HD6SaWPt.js +1 -0
- package/dist/packem_shared/esbuildPlugin-BStpbA6S.js +1 -0
- package/dist/packem_shared/swcPlugin-DBBN5mct.js +1 -0
- package/dist/packem_shared/types.d-Dmpk2asd.d.ts +7 -0
- package/dist/packem_shared/types.d-DrgzeMBs.d-CG9J1x6q.d.ts +6 -0
- package/dist/packem_shared/types.d-KBgVO47q.d.ts +658 -0
- package/dist/plugins/chunk-splitter/index.d.ts +2 -5
- package/dist/plugins/chunk-splitter/index.js +1 -0
- package/dist/plugins/cjs-interop.d.ts +9 -5
- package/dist/plugins/cjs-interop.js +2 -2
- package/dist/plugins/esbuild/index.d.ts +11 -3
- package/dist/plugins/esbuild/index.js +1 -1
- package/dist/plugins/json.d.ts +5 -4
- package/dist/plugins/json.js +1 -1
- package/dist/plugins/jsx-remove-attributes.d.ts +9 -5
- package/dist/plugins/jsx-remove-attributes.js +1 -1
- package/dist/plugins/preserve-directives.d.ts +14 -15
- package/dist/plugins/preserve-directives.js +3 -3
- package/dist/plugins/pure-new-expression-plugin.d.ts +10 -9
- package/dist/plugins/pure-new-expression-plugin.js +1 -0
- package/dist/plugins/sucrase/index.d.ts +101 -7
- package/dist/plugins/sucrase/index.js +1 -1
- package/dist/plugins/swc/index.d.ts +11 -2
- package/dist/plugins/swc/index.js +1 -1
- package/package.json +22 -105
- package/dist/packem_shared/browserslistToEsbuild-C0IWmbNe.js +0 -1
- package/dist/packem_shared/cachingPlugin-DLKoeQeF.js +0 -1
- package/dist/packem_shared/chunkSplitter-DWAy1JkE.js +0 -1
- package/dist/packem_shared/createSplitChunks-BrEBZq7d.js +0 -1
- package/dist/packem_shared/esbuildPlugin-C5x4_cXf.js +0 -1
- package/dist/packem_shared/fixDynamicImportExtension-BBGNRniz.js +0 -1
- package/dist/packem_shared/getCustomModuleLayer-d8i66lfh.js +0 -1
- package/dist/packem_shared/getModuleLayer-rF9RxnJ5.js +0 -1
- package/dist/packem_shared/index-QEzU3Fey.js +0 -1
- package/dist/packem_shared/metafilePlugin-CVcqFpPJ.js +0 -1
- package/dist/packem_shared/oxcResolvePlugin-SH1JFonc.js +0 -1
- package/dist/packem_shared/oxcTransformPlugin-BGmQroQ4.js +0 -4
- package/dist/packem_shared/patchTypescriptTypes-CZ4v3hr9.js +0 -6
- package/dist/packem_shared/pureNewExpressionPlugin-DX9yMcH2.js +0 -1
- package/dist/packem_shared/resolveFileUrlPlugin-BkpjVHeK.js +0 -1
- package/dist/packem_shared/resolveTsconfigPathsPlugin-CEasmDpi.js +0 -1
- package/dist/packem_shared/resolveTsconfigRootDirectoriesPlugin-Cwj3tqCJ.js +0 -1
- package/dist/packem_shared/resolveTypescriptMjsCtsPlugin-DX9at4BX.js +0 -1
- package/dist/packem_shared/swcPlugin-Boip4lWG.js +0 -1
- package/dist/plugins/babel/index.d.ts +0 -10
- package/dist/plugins/babel/index.js +0 -1
- package/dist/plugins/cache-plugin.d.ts +0 -11
- package/dist/plugins/chunk-splitter/gather.d.ts +0 -8
- package/dist/plugins/chunk-splitter/parse/index.d.ts +0 -4
- package/dist/plugins/chunk-splitter/parse/types.d.ts +0 -24
- package/dist/plugins/copy.d.ts +0 -23
- package/dist/plugins/copy.js +0 -1
- package/dist/plugins/data-uri.d.ts +0 -25
- package/dist/plugins/data-uri.js +0 -1
- package/dist/plugins/debarrel.d.ts +0 -7
- package/dist/plugins/debarrel.js +0 -2
- package/dist/plugins/esbuild/browserslist-to-esbuild.d.ts +0 -2
- package/dist/plugins/esbuild/esbuild-plugin.d.ts +0 -3
- package/dist/plugins/esbuild/types.d.ts +0 -39
- package/dist/plugins/esbuild/utils/get-render-chunk.d.ts +0 -14
- package/dist/plugins/esbuild/utils/optimize-deps.d.ts +0 -3
- package/dist/plugins/esbuild/utils/warn.d.ts +0 -4
- package/dist/plugins/esm-shim-cjs-syntax.d.ts +0 -9
- package/dist/plugins/esm-shim-cjs-syntax.js +0 -11
- package/dist/plugins/fix-dts-default-cjs-exports-util.d.ts +0 -35
- package/dist/plugins/fix-dts-default-cjs-exports.d.ts +0 -26
- package/dist/plugins/fix-dts-default-cjs-exports.js +0 -26
- package/dist/plugins/fix-dynamic-import-extension.d.ts +0 -3
- package/dist/plugins/import-attributes.d.ts +0 -2
- package/dist/plugins/import-attributes.js +0 -1
- package/dist/plugins/license.d.ts +0 -17
- package/dist/plugins/license.js +0 -13
- package/dist/plugins/metafile.d.ts +0 -3
- package/dist/plugins/minify-html-literals/index.d.ts +0 -41
- package/dist/plugins/minify-html-literals/index.js +0 -3
- package/dist/plugins/minify-html-literals/lib/minify-html-literals.d.ts +0 -200
- package/dist/plugins/minify-html-literals/lib/models.d.ts +0 -25
- package/dist/plugins/minify-html-literals/lib/parse-literals.d.ts +0 -13
- package/dist/plugins/minify-html-literals/lib/strategy.d.ts +0 -69
- package/dist/plugins/minify-html-literals/lib/typescript.d.ts +0 -23
- package/dist/plugins/native-modules-plugin.d.ts +0 -14
- package/dist/plugins/native-modules-plugin.js +0 -1
- package/dist/plugins/oxc/index.d.ts +0 -3
- package/dist/plugins/oxc/index.js +0 -1
- package/dist/plugins/oxc/oxc-resolve-plugin.d.ts +0 -4
- package/dist/plugins/oxc/oxc-transformer-plugin.d.ts +0 -3
- package/dist/plugins/oxc/types.d.ts +0 -16
- package/dist/plugins/raw.d.ts +0 -7
- package/dist/plugins/raw.js +0 -6
- package/dist/plugins/require-cjs-transformer.d.ts +0 -43
- package/dist/plugins/require-cjs-transformer.js +0 -21
- package/dist/plugins/resolve-file-url.d.ts +0 -3
- package/dist/plugins/shebang.d.ts +0 -9
- package/dist/plugins/shebang.js +0 -4
- package/dist/plugins/source-maps.d.ts +0 -7
- package/dist/plugins/source-maps.js +0 -1
- package/dist/plugins/swc/swc-plugin.d.ts +0 -3
- package/dist/plugins/swc/types.d.ts +0 -6
- package/dist/plugins/typescript/index.d.ts +0 -7
- package/dist/plugins/typescript/index.js +0 -1
- package/dist/plugins/typescript/patch-typescript-types.d.ts +0 -13
- package/dist/plugins/typescript/resolve-tsconfig-paths-plugin.d.ts +0 -11
- package/dist/plugins/typescript/resolve-tsconfig-root-dirs.d.ts +0 -24
- package/dist/plugins/typescript/resolve-typescript-mjs-cjs.d.ts +0 -3
- package/dist/plugins/url.d.ts +0 -72
- package/dist/plugins/url.js +0 -1
- package/dist/types.d.ts +0 -127
- package/dist/utils/chunks/create-split-chunks.d.ts +0 -11
- package/dist/utils/chunks/get-custom-module-layer.d.ts +0 -2
- package/dist/utils/chunks/get-module-layer.d.ts +0 -10
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/is-pure-cjs.d.ts +0 -9
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type { PatchTypesOptions } from "./patch-typescript-types.d.ts";
|
|
2
|
-
export { patchTypescriptTypes } from "./patch-typescript-types.d.ts";
|
|
3
|
-
export { patchTypescriptTypes as patchTypescriptTypesPlugin } from "./patch-typescript-types.d.ts";
|
|
4
|
-
export type { TsconfigPathsPluginOptions } from "./resolve-tsconfig-paths-plugin.d.ts";
|
|
5
|
-
export { resolveTsconfigPathsPlugin } from "./resolve-tsconfig-paths-plugin.d.ts";
|
|
6
|
-
export { default as resolveTsconfigRootDirectoriesPlugin } from "./resolve-tsconfig-root-dirs.d.ts";
|
|
7
|
-
export { default as resolveTypescriptMjsCtsPlugin } from "./resolve-typescript-mjs-cjs.d.ts";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{patchTypescriptTypes as p,patchTypescriptTypes as r}from"../../packem_shared/patchTypescriptTypes-CZ4v3hr9.js";import{resolveTsconfigPathsPlugin as o}from"../../packem_shared/resolveTsconfigPathsPlugin-CEasmDpi.js";import{default as c}from"../../packem_shared/resolveTsconfigRootDirectoriesPlugin-Cwj3tqCJ.js";import{default as l}from"../../packem_shared/resolveTypescriptMjsCtsPlugin-DX9at4BX.js";export{p as patchTypescriptTypes,r as patchTypescriptTypesPlugin,o as resolveTsconfigPathsPlugin,c as resolveTsconfigRootDirectoriesPlugin,l as resolveTypescriptMjsCtsPlugin};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "rollup";
|
|
2
|
-
export type PatchTypesOptions = {
|
|
3
|
-
identifierReplacements?: Record<string, Record<string, string>>;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Patch the types files before passing to dts plugin
|
|
7
|
-
*
|
|
8
|
-
* 1. Validate unallowed dependency imports
|
|
9
|
-
* 2. Replace confusing type names
|
|
10
|
-
* 3. Strip leftover internal types
|
|
11
|
-
* 4. Clean unnecessary comments
|
|
12
|
-
*/
|
|
13
|
-
export declare const patchTypescriptTypes: (options: PatchTypesOptions, logger: Console) => Plugin;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { TsConfigResult } from "@visulima/tsconfig";
|
|
2
|
-
import type { Plugin } from "rollup";
|
|
3
|
-
export type TsconfigPathsPluginOptions = {
|
|
4
|
-
resolveAbsolutePath?: boolean;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Handles tsconfig.json or jsconfig.js "paths" option for webpack
|
|
8
|
-
* Largely based on how the TypeScript compiler handles it:
|
|
9
|
-
* https://github.com/microsoft/TypeScript/blob/1a9c8197fffe3dace5f8dca6633d450a88cba66d/src/compiler/moduleNameResolver.ts#L1362
|
|
10
|
-
*/
|
|
11
|
-
export declare const resolveTsconfigPathsPlugin: (rootDirectory: string, tsconfig: TsConfigResult, logger: Console, pluginOptions: TsconfigPathsPluginOptions) => Plugin;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { TsConfigResult } from "@visulima/tsconfig";
|
|
2
|
-
import type { Plugin } from "rollup";
|
|
3
|
-
/**
|
|
4
|
-
* This plugin resolves module paths using the rootDirs configuration from the tsconfig.json file.
|
|
5
|
-
*
|
|
6
|
-
* Consider the following example configuration:
|
|
7
|
-
* @example
|
|
8
|
-
* ```json
|
|
9
|
-
* {
|
|
10
|
-
* "compilerOptions": {
|
|
11
|
-
* "rootDirs": ["lib"]
|
|
12
|
-
* }
|
|
13
|
-
* }
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* This configuration will allow you to import modules from the `src` and `lib` directories.
|
|
17
|
-
*
|
|
18
|
-
* ```typescript
|
|
19
|
-
* import { foo } from "./foo.d.ts"; -> ./src/foo
|
|
20
|
-
* import { bar } from "./bar.d.ts"; // -> ./lib/bar
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
declare const resolveTsconfigRootDirectories: (cwd: string, logger: Console, tsconfig: TsConfigResult) => Plugin;
|
|
24
|
-
export default resolveTsconfigRootDirectories;
|
package/dist/plugins/url.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { FilterPattern } from "@rollup/pluginutils";
|
|
2
|
-
import type { Plugin } from "rollup";
|
|
3
|
-
export interface UrlOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The destination dir to copy assets, usually used to rebase the assets according to HTML files.
|
|
6
|
-
* @type {string}
|
|
7
|
-
*/
|
|
8
|
-
destDir?: string;
|
|
9
|
-
/**
|
|
10
|
-
* If false, will prevent files being emitted by this plugin. This is useful for when you are using Rollup to emit both a client-side and server-side bundle.
|
|
11
|
-
* @type {boolean}
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
emitFiles: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* A picomatch pattern, or array of patterns, which specifies the files in the build the plugin
|
|
17
|
-
* should _ignore_.
|
|
18
|
-
*
|
|
19
|
-
* By default, no files are ignored.
|
|
20
|
-
* @type {FilterPattern}
|
|
21
|
-
*/
|
|
22
|
-
exclude?: FilterPattern;
|
|
23
|
-
/**
|
|
24
|
-
* If emitFiles is true, this option can be used to rename the emitted files. It accepts the following string replacements:
|
|
25
|
-
* [hash] - The hash value of the file's contents
|
|
26
|
-
* [name] - The name of the imported file (without its file extension)
|
|
27
|
-
* [extname] - The extension of the imported file (including the leading .)
|
|
28
|
-
* [dirname] - The parent directory name of the imported file (including trailing /)
|
|
29
|
-
* @type {string}
|
|
30
|
-
* @default [hash][extname]
|
|
31
|
-
*/
|
|
32
|
-
fileName: string;
|
|
33
|
-
/**
|
|
34
|
-
* A picomatch pattern, or array of patterns, which specifies the files in the build the plugin
|
|
35
|
-
* should operate on.
|
|
36
|
-
* By default, the png,jpg,jpeg,gif,svg,webp files are targeted.
|
|
37
|
-
* @type {FilterPattern}
|
|
38
|
-
*/
|
|
39
|
-
include?: FilterPattern;
|
|
40
|
-
/**
|
|
41
|
-
* The file size limit for inline files.
|
|
42
|
-
* If a file exceeds this limit, it will be copied to the destination folder and the hashed filename will be provided instead.
|
|
43
|
-
* If limit is set to 0 all files will be copied.
|
|
44
|
-
* @type {number}
|
|
45
|
-
* @default 14336 (14kb)
|
|
46
|
-
*/
|
|
47
|
-
limit: number;
|
|
48
|
-
/**
|
|
49
|
-
* A string which will be added in front of filenames when they are not inlined but are copied.
|
|
50
|
-
* @type {string}
|
|
51
|
-
*/
|
|
52
|
-
publicPath?: string;
|
|
53
|
-
/**
|
|
54
|
-
* When using the [dirname] replacement in fileName, use this directory as the source directory from which to create the file path rather than the parent directory of the imported file. For example:
|
|
55
|
-
* @example
|
|
56
|
-
* ```js
|
|
57
|
-
* src/path/to/file.js
|
|
58
|
-
*
|
|
59
|
-
* import png from './image.d.ts';
|
|
60
|
-
* rollup.config.js
|
|
61
|
-
*
|
|
62
|
-
* url({
|
|
63
|
-
* fileName: '[dirname][hash][extname]',
|
|
64
|
-
* sourceDir: path.join(__dirname, 'src')
|
|
65
|
-
* });
|
|
66
|
-
*
|
|
67
|
-
* Emitted File: path/to/image.png
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
sourceDir?: string;
|
|
71
|
-
}
|
|
72
|
-
export declare const urlPlugin: ({ destDir: destinationDirectory, emitFiles, exclude, fileName, include, limit, publicPath, sourceDir: sourceDirectory, }: UrlOptions) => Plugin;
|
package/dist/plugins/url.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var A=Object.defineProperty;var w=(t,a)=>A(t,"name",{value:a,configurable:!0});import D from"node:crypto";import{createReadStream as S,createWriteStream as j}from"node:fs";import{stat as k,readFile as E}from"node:fs/promises";import{createFilter as O}from"@rollup/pluginutils";import{ensureDir as y}from"@visulima/fs";import{extname as R,basename as P,relative as W,dirname as c,join as u}from"@visulima/path";import{R as z}from"../packem_shared/index-QEzU3Fey.js";import{svgEncoder as B}from"@visulima/packem-share/utils";var C=Object.defineProperty,b=w((t,a)=>C(t,"name",{value:a,configurable:!0}),"g");const H=b(async(t,a)=>{await new Promise((p,m)=>{const s=S(t);s.on("error",m);const i=j(a);i.on("error",m),i.on("finish",()=>p(void 0)),s.pipe(i)})},"copy"),M=b(({destDir:t,emitFiles:a,exclude:p,fileName:m,include:s,limit:i,publicPath:x,sourceDir:f})=>{const F=O(s,p),d={};return{async generateBundle(e){if(!a)return;const l=t??e.dir??c(e.file??"");await y(l),await Promise.all(Object.keys(d).map(async n=>{const r=d[n],o=u(l,c(r));await y(o),await H(n,u(l,r))}))},async load(e){if(!F(e))return;this.addWatchFile(e);const[l,n]=await Promise.all([k(e),E(e)]);let r;if(i&&l.size>i||i===0){const o=D.createHash("sha1").update(n).digest("hex").slice(0,16),g=R(e),$=P(e,g),h=f?W(f,c(e)):P(c(e)),v=m.replaceAll("[hash]",o).replaceAll("[extname]",g).replaceAll("[dirname]",h===""?"":`${h}/`).replaceAll("[name]",$);r=u(x??"",v),d[e]=v}else{const o=z.getType(e);if(o===void 0)throw new Error(`Could not determine mimetype for ${e}`);r=o==="image/svg+xml"?B(n):n.toString("base64"),r=`data:${o};base64,${r}`}return`export default "${r}"`},name:"packem:url"}},"urlPlugin");export{M as urlPlugin};
|
package/dist/types.d.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import type { RollupAliasOptions } from "@rollup/plugin-alias";
|
|
2
|
-
import type { RollupCommonJSOptions } from "@rollup/plugin-commonjs";
|
|
3
|
-
import type { RollupJsonOptions } from "@rollup/plugin-json";
|
|
4
|
-
import type { RollupNodeResolveOptions } from "@rollup/plugin-node-resolve";
|
|
5
|
-
import type { RollupReplaceOptions } from "@rollup/plugin-replace";
|
|
6
|
-
import type { RollupWasmOptions } from "@rollup/plugin-wasm";
|
|
7
|
-
import type { FilterPattern } from "@rollup/pluginutils";
|
|
8
|
-
import type { Options as RollupDtsOptions } from "@visulima/rollup-plugin-dts";
|
|
9
|
-
import type { OutputOptions, Plugin, RollupOptions } from "rollup";
|
|
10
|
-
import type { NodePolyfillsOptions } from "rollup-plugin-polyfill-node";
|
|
11
|
-
import type { PureAnnotationsOptions } from "rollup-plugin-pure";
|
|
12
|
-
import type { PluginVisualizerOptions } from "rollup-plugin-visualizer";
|
|
13
|
-
import type { BabelPluginConfig } from "./plugins/babel/index.d.ts";
|
|
14
|
-
import type { CJSInteropOptions } from "./plugins/cjs-interop.d.ts";
|
|
15
|
-
import type { CopyPluginOptions } from "./plugins/copy.d.ts";
|
|
16
|
-
import type { DataUriPluginOptions } from "./plugins/data-uri.d.ts";
|
|
17
|
-
import type { DebarrelPluginOptions } from "./plugins/debarrel.d.ts";
|
|
18
|
-
import type { EsbuildPluginConfig, Options as EsbuildOptions } from "./plugins/esbuild/types.d.ts";
|
|
19
|
-
import type { EsmShimCjsSyntaxOptions } from "./plugins/esm-shim-cjs-syntax.d.ts";
|
|
20
|
-
import type { JSXRemoveAttributesPlugin } from "./plugins/jsx-remove-attributes.d.ts";
|
|
21
|
-
import type { LicenseOptions } from "./plugins/license.d.ts";
|
|
22
|
-
import type { MinifyHTMLLiteralsOptions } from "./plugins/minify-html-literals/index.d.ts";
|
|
23
|
-
import type { NativeModulesOptions } from "./plugins/native-modules-plugin.d.ts";
|
|
24
|
-
import type { InternalOXCTransformPluginConfig, OxcResolveOptions, OXCTransformPluginConfig } from "./plugins/oxc/types.d.ts";
|
|
25
|
-
import type { RawLoaderOptions } from "./plugins/raw.d.ts";
|
|
26
|
-
import type { Options as RequireCJSPluginOptions } from "./plugins/require-cjs-transformer.d.ts";
|
|
27
|
-
import type { ShebangOptions } from "./plugins/shebang.d.ts";
|
|
28
|
-
import type { SourcemapsPluginOptions } from "./plugins/source-maps.d.ts";
|
|
29
|
-
import type { SucrasePluginConfig } from "./plugins/sucrase/index.d.ts";
|
|
30
|
-
import type { SwcPluginConfig } from "./plugins/swc/types.d.ts";
|
|
31
|
-
import type { PatchTypesOptions } from "./plugins/typescript/patch-typescript-types.d.ts";
|
|
32
|
-
import type { TsconfigPathsPluginOptions } from "./plugins/typescript/resolve-tsconfig-paths-plugin.d.ts";
|
|
33
|
-
import type { UrlOptions } from "./plugins/url.d.ts";
|
|
34
|
-
interface RollupDynamicImportVariablesOptions {
|
|
35
|
-
/**
|
|
36
|
-
* By default, the plugin will not throw errors when target files are not found.
|
|
37
|
-
* Setting this option to true will result in errors thrown when encountering files which don't exist.
|
|
38
|
-
* @default false
|
|
39
|
-
*/
|
|
40
|
-
errorWhenNoFilesFound?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* A picomatch pattern, or array of patterns, which specifies the files in the build the plugin
|
|
43
|
-
* should _ignore_.
|
|
44
|
-
*
|
|
45
|
-
* By default, no files are ignored.
|
|
46
|
-
*/
|
|
47
|
-
exclude?: FilterPattern;
|
|
48
|
-
/**
|
|
49
|
-
* A picomatch pattern, or array of patterns, which specifies the files in the build the plugin
|
|
50
|
-
* should operate on.
|
|
51
|
-
* By default, all files are targeted.
|
|
52
|
-
*/
|
|
53
|
-
include?: FilterPattern;
|
|
54
|
-
/**
|
|
55
|
-
* By default, the plugin quits the build process when it encounters an error.
|
|
56
|
-
* If you set this option to true, it will throw a warning instead and leave the code untouched.
|
|
57
|
-
* @default false
|
|
58
|
-
*/
|
|
59
|
-
warnOnError?: boolean;
|
|
60
|
-
}
|
|
61
|
-
export interface ExtendedRollupNodeResolveOptions extends RollupNodeResolveOptions {
|
|
62
|
-
/**
|
|
63
|
-
* Controls how unresolved import warnings from the node-resolve plugin are handled.
|
|
64
|
-
* - `"error"` (default): Treat unresolved imports as errors, causing the build to fail
|
|
65
|
-
* - `"warn"`: Treat unresolved imports as warnings, allowing the build to continue
|
|
66
|
-
* @default "error"
|
|
67
|
-
*/
|
|
68
|
-
unresolvedImportBehavior?: "error" | "warn";
|
|
69
|
-
}
|
|
70
|
-
export interface PackemRollupOptions {
|
|
71
|
-
alias?: RollupAliasOptions | false;
|
|
72
|
-
babel?: BabelPluginConfig | false;
|
|
73
|
-
cjsInterop?: CJSInteropOptions;
|
|
74
|
-
commonjs?: RollupCommonJSOptions | false;
|
|
75
|
-
copy?: CopyPluginOptions | false;
|
|
76
|
-
dataUri?: DataUriPluginOptions | false;
|
|
77
|
-
debarrel?: DebarrelPluginOptions | false;
|
|
78
|
-
dts?: RollupDtsOptions;
|
|
79
|
-
dynamicVars?: RollupDynamicImportVariablesOptions | false;
|
|
80
|
-
esbuild?: EsbuildOptions | false;
|
|
81
|
-
experimental?: {
|
|
82
|
-
resolve?: OxcResolveOptions | false;
|
|
83
|
-
};
|
|
84
|
-
json?: RollupJsonOptions | false;
|
|
85
|
-
jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
|
|
86
|
-
license?: LicenseOptions | false;
|
|
87
|
-
metafile?: boolean;
|
|
88
|
-
minifyHTMLLiterals?: MinifyHTMLLiteralsOptions | false;
|
|
89
|
-
nativeModules?: NativeModulesOptions | false;
|
|
90
|
-
output?: OutputOptions;
|
|
91
|
-
oxc?: Omit<OXCTransformPluginConfig, "cwd" | "sourcemap" | "target"> | false;
|
|
92
|
-
patchTypes?: PatchTypesOptions | false;
|
|
93
|
-
plugins?: RollupPlugins;
|
|
94
|
-
polyfillNode?: NodePolyfillsOptions | false;
|
|
95
|
-
preserveDirectives?: {
|
|
96
|
-
directiveRegex?: RegExp;
|
|
97
|
-
exclude?: FilterPattern;
|
|
98
|
-
include?: FilterPattern;
|
|
99
|
-
};
|
|
100
|
-
preserveDynamicImports?: boolean;
|
|
101
|
-
pure?: Omit<PureAnnotationsOptions, "sourcemap"> | false;
|
|
102
|
-
raw?: RawLoaderOptions | false;
|
|
103
|
-
replace?: Omit<RollupReplaceOptions, "cwd"> | false;
|
|
104
|
-
requireCJS?: RequireCJSPluginOptions | false;
|
|
105
|
-
resolve?: ExtendedRollupNodeResolveOptions | false;
|
|
106
|
-
shebang?: Partial<ShebangOptions> | false;
|
|
107
|
-
shim?: EsmShimCjsSyntaxOptions | false;
|
|
108
|
-
sourcemap?: SourcemapsPluginOptions;
|
|
109
|
-
sucrase?: SucrasePluginConfig | false;
|
|
110
|
-
swc?: SwcPluginConfig | false;
|
|
111
|
-
treeshake?: RollupOptions["treeshake"];
|
|
112
|
-
tsconfigPaths?: TsconfigPathsPluginOptions | false;
|
|
113
|
-
url?: UrlOptions | false;
|
|
114
|
-
visualizer?: PluginVisualizerOptions | false;
|
|
115
|
-
wasm?: RollupWasmOptions | false;
|
|
116
|
-
watch?: RollupOptions["watch"];
|
|
117
|
-
}
|
|
118
|
-
export type RollupPlugins = {
|
|
119
|
-
enforce?: "post" | "pre";
|
|
120
|
-
plugin: Plugin;
|
|
121
|
-
type?: "build" | "dts";
|
|
122
|
-
}[];
|
|
123
|
-
export type TransformerFn = ((config: EsbuildPluginConfig | InternalOXCTransformPluginConfig | SucrasePluginConfig | SwcPluginConfig) => Plugin) & {
|
|
124
|
-
NAME?: TransformerName;
|
|
125
|
-
};
|
|
126
|
-
export type TransformerName = "esbuild" | "oxc" | "sucrase" | "swc";
|
|
127
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/huozhi/bunchee/blob/3cb85160bbad3af229654cc09d6fcd67120fe8bd/src/lib/split-chunk.ts
|
|
3
|
-
*
|
|
4
|
-
* The MIT License (MIT)
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2018 these people -> https://github.com/huozhi/bunchee/graphs/contributors
|
|
7
|
-
*/
|
|
8
|
-
import type { BuildContextBuildAssetAndChunk, BuildContextBuildEntry } from "@visulima/packem-share/types";
|
|
9
|
-
import type { GetManualChunk } from "rollup";
|
|
10
|
-
declare const createSplitChunks: (dependencyGraphMap: Map<string, Set<[string, string]>>, entryFiles: (BuildContextBuildAssetAndChunk | BuildContextBuildEntry)[]) => GetManualChunk;
|
|
11
|
-
export default createSplitChunks;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/huozhi/bunchee/blob/3cb85160bbad3af229654cc09d6fcd67120fe8bd/src/lib/split-chunk.ts
|
|
3
|
-
*
|
|
4
|
-
* The MIT License (MIT)
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2018 these people -> https://github.com/huozhi/bunchee/graphs/contributors
|
|
7
|
-
*/
|
|
8
|
-
import type { CustomPluginOptions } from "rollup";
|
|
9
|
-
declare const getModuleLayer: (moduleMeta: CustomPluginOptions) => any;
|
|
10
|
-
export default getModuleLayer;
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { default as createSplitChunks } from "./chunks/create-split-chunks.d.ts";
|
|
2
|
-
export { default as getCustomModuleLayer } from "./chunks/get-custom-module-layer.d.ts";
|
|
3
|
-
export { default as getModuleLayer } from "./chunks/get-module-layer.d.ts";
|
|
4
|
-
export { arrayify, enhanceRollupError, FileCache, getChunkFilename, getEntryFileNames, getHash, getPackageName, memoize, memoizeByKey, replaceContentWithinMarker, sortUserPlugins, svgEncoder, } from "@visulima/packem-share/utils";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ResolvedId } from "rollup";
|
|
2
|
-
/**
|
|
3
|
-
* Determines if a module is a pure CommonJS module by checking various indicators.
|
|
4
|
-
* @param id The module ID to check
|
|
5
|
-
* @param importer The importer context (can be a file path or Rollup plugin context)
|
|
6
|
-
* @param rollupResolve Optional Rollup resolve function for better module resolution
|
|
7
|
-
*/
|
|
8
|
-
export declare const isPureCJS: (id: string, importer: string, rollupResolve?: (id: string, importer?: string) => Promise<ResolvedId | null>) => Promise<boolean>;
|
|
9
|
-
export default isPureCJS;
|