@utoo/pack 1.1.2-alpha.4 → 1.1.2-alpha.5

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/cjs/types.d.ts CHANGED
@@ -98,21 +98,6 @@ export interface ExternalAdvanced {
98
98
  script?: string;
99
99
  }
100
100
  export type ExternalConfig = string | ExternalAdvanced;
101
- /**
102
- * Provider configuration for automatic module imports.
103
- * Similar to webpack's ProvidePlugin.
104
- *
105
- * @example
106
- * ```ts
107
- * provider: {
108
- * // Provides `$` as `import $ from 'jquery'`
109
- * $: 'jquery',
110
- * // Provides `Buffer` as `import { Buffer } from 'buffer'`
111
- * Buffer: ['buffer', 'Buffer'],
112
- * }
113
- * ```
114
- */
115
- export type ProviderConfig = Record<string, string | [string, string]>;
116
101
  export interface ConfigComplete {
117
102
  entry: EntryOptions[];
118
103
  mode?: "production" | "development";
@@ -134,7 +119,6 @@ export interface ConfigComplete {
134
119
  target?: string;
135
120
  sourceMaps?: boolean;
136
121
  define?: Record<string, string>;
137
- provider?: ProviderConfig;
138
122
  optimization?: {
139
123
  moduleIds?: "named" | "deterministic";
140
124
  minify?: boolean;
@@ -29,7 +29,6 @@ function compatOptionsFromWebpack(webpackConfig, projectPath, rootPath) {
29
29
  sourceMaps: compatSourceMaps(devtool),
30
30
  optimization: compatOptimization(optimization),
31
31
  define: compatFromWebpackPlugin(plugins, compatDefine),
32
- provider: compatFromWebpackPlugin(plugins, compatProvider),
33
32
  stats: compatStats(stats),
34
33
  },
35
34
  buildId: webpackConfig.name,
@@ -130,31 +129,6 @@ function compatDefine(maybeWebpackPluginInstance) {
130
129
  }
131
130
  return processedDefinitions;
132
131
  }
133
- compatProvider.pluginName = "ProvidePlugin";
134
- function compatProvider(maybeWebpackPluginInstance) {
135
- const definitions = maybeWebpackPluginInstance === null || maybeWebpackPluginInstance === void 0 ? void 0 : maybeWebpackPluginInstance.definitions;
136
- if (!definitions || typeof definitions !== "object") {
137
- return undefined;
138
- }
139
- const provider = {};
140
- for (const [key, value] of Object.entries(definitions)) {
141
- if (typeof value === "string") {
142
- // Simple module import: { $: 'jquery' }
143
- provider[key] = value;
144
- }
145
- else if (Array.isArray(value)) {
146
- if (value.length === 1) {
147
- // e.g. { process: ['process/browser'] } for default import
148
- provider[key] = value[0];
149
- }
150
- else if (value.length >= 2) {
151
- // Named export import: { Buffer: ['buffer', 'Buffer'] }
152
- provider[key] = [value[0], value[1]];
153
- }
154
- }
155
- }
156
- return Object.keys(provider).length > 0 ? provider : undefined;
157
- }
158
132
  function compatExternals(webpackExternals) {
159
133
  if (!webpackExternals) {
160
134
  return undefined;
package/esm/types.d.ts CHANGED
@@ -98,21 +98,6 @@ export interface ExternalAdvanced {
98
98
  script?: string;
99
99
  }
100
100
  export type ExternalConfig = string | ExternalAdvanced;
101
- /**
102
- * Provider configuration for automatic module imports.
103
- * Similar to webpack's ProvidePlugin.
104
- *
105
- * @example
106
- * ```ts
107
- * provider: {
108
- * // Provides `$` as `import $ from 'jquery'`
109
- * $: 'jquery',
110
- * // Provides `Buffer` as `import { Buffer } from 'buffer'`
111
- * Buffer: ['buffer', 'Buffer'],
112
- * }
113
- * ```
114
- */
115
- export type ProviderConfig = Record<string, string | [string, string]>;
116
101
  export interface ConfigComplete {
117
102
  entry: EntryOptions[];
118
103
  mode?: "production" | "development";
@@ -134,7 +119,6 @@ export interface ConfigComplete {
134
119
  target?: string;
135
120
  sourceMaps?: boolean;
136
121
  define?: Record<string, string>;
137
- provider?: ProviderConfig;
138
122
  optimization?: {
139
123
  moduleIds?: "named" | "deterministic";
140
124
  minify?: boolean;
@@ -22,7 +22,6 @@ export function compatOptionsFromWebpack(webpackConfig, projectPath, rootPath) {
22
22
  sourceMaps: compatSourceMaps(devtool),
23
23
  optimization: compatOptimization(optimization),
24
24
  define: compatFromWebpackPlugin(plugins, compatDefine),
25
- provider: compatFromWebpackPlugin(plugins, compatProvider),
26
25
  stats: compatStats(stats),
27
26
  },
28
27
  buildId: webpackConfig.name,
@@ -123,31 +122,6 @@ function compatDefine(maybeWebpackPluginInstance) {
123
122
  }
124
123
  return processedDefinitions;
125
124
  }
126
- compatProvider.pluginName = "ProvidePlugin";
127
- function compatProvider(maybeWebpackPluginInstance) {
128
- const definitions = maybeWebpackPluginInstance === null || maybeWebpackPluginInstance === void 0 ? void 0 : maybeWebpackPluginInstance.definitions;
129
- if (!definitions || typeof definitions !== "object") {
130
- return undefined;
131
- }
132
- const provider = {};
133
- for (const [key, value] of Object.entries(definitions)) {
134
- if (typeof value === "string") {
135
- // Simple module import: { $: 'jquery' }
136
- provider[key] = value;
137
- }
138
- else if (Array.isArray(value)) {
139
- if (value.length === 1) {
140
- // e.g. { process: ['process/browser'] } for default import
141
- provider[key] = value[0];
142
- }
143
- else if (value.length >= 2) {
144
- // Named export import: { Buffer: ['buffer', 'Buffer'] }
145
- provider[key] = [value[0], value[1]];
146
- }
147
- }
148
- }
149
- return Object.keys(provider).length > 0 ? provider : undefined;
150
- }
151
125
  function compatExternals(webpackExternals) {
152
126
  if (!webpackExternals) {
153
127
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/pack",
3
- "version": "1.1.2-alpha.4",
3
+ "version": "1.1.2-alpha.5",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "types": "esm/index.d.ts",
@@ -89,12 +89,12 @@
89
89
  },
90
90
  "repository": "git@github.com:utooland/utoo.git",
91
91
  "optionalDependencies": {
92
- "@utoo/pack-darwin-arm64": "1.1.2-alpha.4",
93
- "@utoo/pack-darwin-x64": "1.1.2-alpha.4",
94
- "@utoo/pack-linux-arm64-gnu": "1.1.2-alpha.4",
95
- "@utoo/pack-linux-arm64-musl": "1.1.2-alpha.4",
96
- "@utoo/pack-linux-x64-gnu": "1.1.2-alpha.4",
97
- "@utoo/pack-linux-x64-musl": "1.1.2-alpha.4",
98
- "@utoo/pack-win32-x64-msvc": "1.1.2-alpha.4"
92
+ "@utoo/pack-darwin-arm64": "1.1.2-alpha.5",
93
+ "@utoo/pack-darwin-x64": "1.1.2-alpha.5",
94
+ "@utoo/pack-linux-arm64-gnu": "1.1.2-alpha.5",
95
+ "@utoo/pack-linux-arm64-musl": "1.1.2-alpha.5",
96
+ "@utoo/pack-linux-x64-gnu": "1.1.2-alpha.5",
97
+ "@utoo/pack-linux-x64-musl": "1.1.2-alpha.5",
98
+ "@utoo/pack-win32-x64-msvc": "1.1.2-alpha.5"
99
99
  }
100
100
  }