xshell 1.2.21 → 1.2.22

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/builder.d.ts CHANGED
@@ -90,6 +90,7 @@ export interface BundlerOptions {
90
90
  js: string;
91
91
  entry: string;
92
92
  };
93
+ plugins?: Webpack.Configuration['plugins'];
93
94
  }
94
95
  export declare class Bundler {
95
96
  name: string;
@@ -108,6 +109,7 @@ export declare class Bundler {
108
109
  single_js?: BundlerOptions['single_js'];
109
110
  globals?: BundlerOptions['globals'];
110
111
  exclude_modules?: BundlerOptions['exclude_modules'];
112
+ plugins?: BundlerOptions['plugins'];
111
113
  license?: boolean;
112
114
  lcompiler: Lock<Webpack.Compiler>;
113
115
  /** 通过 webpack 从入口文件打包所有依赖生成单个 index.{mjs,cjs} 文件
@@ -147,8 +149,9 @@ export declare class Bundler {
147
149
  - cache_version?: webpack cache version, 用于区分同一个 name 的不同版本
148
150
  - production?: `true` webpack mode 设置为 'production'
149
151
  - sass?: 传入 sass 实例避免 webpack 重复加载 .cjs 版本
152
+ - plugins?: 可选传入的额外的 webpack 插件
150
153
  - license?: 使用 license-webpack-plugin 构建 ThirdPartyNotice.txt */
151
- constructor(name: string, target: 'web' | 'nodejs', fpd_root: string, fpd_out: string, fpdt_cache: string, entry: Record<string, string>, { source_map, globals, external_dayjs, externals, htmls, assets, assets_root, template, single_js, commonjs2, expose, single_chunk, dynamic_import, resolve_alias, resolve_fallback, assets_stats, analyzer, dts, exclude_modules, cache_version, production, sass, dependencies, license, }?: BundlerOptions);
154
+ constructor(name: string, target: 'web' | 'nodejs', fpd_root: string, fpd_out: string, fpdt_cache: string, entry: Record<string, string>, { source_map, globals, external_dayjs, externals, htmls, assets, assets_root, template, single_js, commonjs2, expose, single_chunk, dynamic_import, resolve_alias, resolve_fallback, assets_stats, analyzer, dts, exclude_modules, cache_version, production, sass, dependencies, plugins, license, }?: BundlerOptions);
152
155
  build(print?: boolean): Promise<void>;
153
156
  close(): Promise<void>;
154
157
  build_all(print?: boolean): Promise<void>;
package/builder.js CHANGED
@@ -140,6 +140,7 @@ export class Bundler {
140
140
  single_js;
141
141
  globals;
142
142
  exclude_modules;
143
+ plugins;
143
144
  license;
144
145
  lcompiler;
145
146
  /** 通过 webpack 从入口文件打包所有依赖生成单个 index.{mjs,cjs} 文件
@@ -179,8 +180,9 @@ export class Bundler {
179
180
  - cache_version?: webpack cache version, 用于区分同一个 name 的不同版本
180
181
  - production?: `true` webpack mode 设置为 'production'
181
182
  - sass?: 传入 sass 实例避免 webpack 重复加载 .cjs 版本
183
+ - plugins?: 可选传入的额外的 webpack 插件
182
184
  - license?: 使用 license-webpack-plugin 构建 ThirdPartyNotice.txt */
183
- constructor(name, target, fpd_root, fpd_out, fpdt_cache, entry, { source_map = true, globals, external_dayjs = false, externals, htmls, assets, assets_root = '/', template = false, single_js, commonjs2 = false, expose = false, single_chunk = true, dynamic_import = true, resolve_alias, resolve_fallback, assets_stats = true, analyzer = false, dts = false, exclude_modules, cache_version, production = true, sass, dependencies, license, } = {}) {
185
+ constructor(name, target, fpd_root, fpd_out, fpdt_cache, entry, { source_map = true, globals, external_dayjs = false, externals, htmls, assets, assets_root = '/', template = false, single_js, commonjs2 = false, expose = false, single_chunk = true, dynamic_import = true, resolve_alias, resolve_fallback, assets_stats = true, analyzer = false, dts = false, exclude_modules, cache_version, production = true, sass, dependencies, plugins, license, } = {}) {
184
186
  this.name = name;
185
187
  this.analyzer = analyzer;
186
188
  this.production = production;
@@ -195,6 +197,7 @@ export class Bundler {
195
197
  this.single_js = single_js;
196
198
  this.globals = globals;
197
199
  this.exclude_modules = exclude_modules;
200
+ this.plugins = plugins;
198
201
  if (dependencies) {
199
202
  check(target === 'web');
200
203
  this.dependencies = dependencies;
@@ -472,6 +475,7 @@ export class Bundler {
472
475
  })
473
476
  ];
474
477
  })() : [],
478
+ ...this.plugins || [],
475
479
  ];
476
480
  this.lcompiler = new Lock(Webpack(this.config));
477
481
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.2.21",
3
+ "version": "1.2.22",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {