@ms-cloudpack/bundler-webpack 0.4.3 → 0.4.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/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { webpack as default } from './webpack.js';
1
+ export { webpack as default, type WebpackCapabilityConfig } from './webpack.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { webpack as default } from './webpack.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAgC,MAAM,cAAc,CAAC","sourcesContent":["export { webpack as default, type WebpackCapabilityConfig } from './webpack.js';\n"]}
package/lib/webpack.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  import type { Bundler } from '@ms-cloudpack/common-types';
2
+ import { type Configuration } from 'webpack';
3
+ export type WebpackCapabilityConfig = Configuration;
2
4
  export declare const webpack: Bundler;
3
5
  //# sourceMappingURL=webpack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA6C,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAUrG,eAAO,MAAM,OAAO,EAAE,OAmDrB,CAAC"}
1
+ {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,OAAO,EAER,MAAM,4BAA4B,CAAC;AAEpC,OAAmB,EAAE,KAAK,aAAa,EAAc,MAAM,SAAS,CAAC;AAQrE,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAEpD,eAAO,MAAM,OAAO,EAAE,OAmDrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.js","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,UAA0B,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,WAAW,GAAG,SAAS,CAAC;AAE9B,MAAM,CAAC,MAAM,OAAO,GAAY;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,UAAU,CAAC,OAAO;IAC3B,MAAM,EAAE,KAAK,WAAW,OAAO,EAAE,OAAO;QACtC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACpE,IAAI,MAAM,EAAE,MAAM,EAAE,CAAC;YACnB,OAAO,EAAE,MAAM,EAAE,CAAC;QACpB,CAAC;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC;QAE3D,MAAM,yBAAyB,GAAG,CAAC,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W,EAAE,CAAC;YACzG,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;gBACtC,oCAAoC;gBACpC,YAAY,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;YACjH,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,CAAC,YAAY,CAAC;gBACtB,QAAQ,EAAE,MAAiC;aAC5C,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { processCapabilities } from '@ms-cloudpack/bundler-capabilities';\nimport type { BundleMessage, BundlerCapabilitiesOptions, Bundler } from '@ms-cloudpack/common-types';\nimport { writeESMStubsInWorker } from '@ms-cloudpack/esm-stub-utilities';\nimport runWebpack, { type Stats } from 'webpack';\nimport { getWebpackConfiguration } from './getWebpackConfiguration.js';\nimport { normalizeWebpackOutput } from './normalizeWebpackOutput.js';\nimport { webpackCapabilities } from './webpackCapabilities.js';\nimport { base64AssetExtensions } from '@ms-cloudpack/bundler-utilities';\n\nconst bundlerName = 'webpack';\n\nexport const webpack: Bundler = {\n name: bundlerName,\n version: runWebpack.version,\n bundle: async function (options, context) {\n const { errors, newEntries } = await writeESMStubsInWorker(options);\n if (errors?.length) {\n return { errors };\n }\n\n const outputPath = options.outputPath ?? options.inputPath;\n\n const defaultExtensionsToInline = [...base64AssetExtensions];\n const { unsafeDisableInlineSvg = false } = options.bundlerOptions || {};\n // TODO: This will be deleted in the upcoming PRs\n if (!unsafeDisableInlineSvg) {\n defaultExtensionsToInline.push('.svg');\n }\n\n const bundlerCapabilitiesOptions: BundlerCapabilitiesOptions = {\n // Enable asset-inline by default for common image types\n 'asset-inline': { extensions: defaultExtensionsToInline },\n ...(options.bundlerCapabilities || {}),\n };\n\n const config = await processCapabilities({\n bundlerName,\n baseConfig: getWebpackConfiguration({ options, outputPath, newEntries }, context),\n bundlerCapabilitiesOptions,\n internalCapabilities: webpackCapabilities,\n bundlerCapabilitiesRegistry: context.config.bundlerCapabilitiesRegistry,\n });\n\n try {\n const stats = await new Promise<Stats | undefined>((resolve, reject) => {\n runWebpack(config, (err, statsResult) => (err ? reject(err) : resolve(statsResult)));\n });\n\n // Normalize the output outside the callback, so if there's an exception it's not swallowed\n return normalizeWebpackOutput({ stats, config, outputPath, options });\n } catch (err) {\n const errorMessage: BundleMessage = { text: (err as Error).message || String(err), source: bundlerName };\n if (err instanceof Error && err.stack) {\n // remove the message from the stack\n errorMessage.notes = [{ text: err.stack.includes(err.message) ? err.stack.split(err.message)[1] : err.stack }];\n }\n return {\n errors: [errorMessage],\n rawInput: config as Record<string, unknown>,\n };\n }\n },\n};\n"]}
1
+ {"version":3,"file":"webpack.js","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAOzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,UAA8C,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,WAAW,GAAG,SAAS,CAAC;AAI9B,MAAM,CAAC,MAAM,OAAO,GAAY;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,UAAU,CAAC,OAAO;IAC3B,MAAM,EAAE,KAAK,WAAW,OAAO,EAAE,OAAO;QACtC,MAAM,EAAE,MAAM,EAA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FAA2F;YAC3F,OAAO,sBAAsB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;QACxE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,YAAY,GAAkB,EAAE,IAAI,EAAG,GAAa,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;YACzG,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;gBACtC,oCAAoC;gBACpC,YAAY,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;YACjH,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,CAAC,YAAY,CAAC;gBACtB,QAAQ,EAAE,MAAiC;aAC5C,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { processCapabilities } from '@ms-cloudpack/bundler-capabilities';\nimport type {\n BundleMessage,\n BundlerCapabilitiesOptions,\n Bundler,\n InternalBundlerCapabilitiesOptions,\n} from '@ms-cloudpack/common-types';\nimport { writeESMStubsInWorker } from '@ms-cloudpack/esm-stub-utilities';\nimport runWebpack, { type Configuration, type Stats } from 'webpack';\nimport { getWebpackConfiguration } from './getWebpackConfiguration.js';\nimport { normalizeWebpackOutput } from './normalizeWebpackOutput.js';\nimport { webpackCapabilities } from './webpackCapabilities.js';\nimport { base64AssetExtensions } from '@ms-cloudpack/bundler-utilities';\n\nconst bundlerName = 'webpack';\n\nexport type WebpackCapabilityConfig = Configuration;\n\nexport const webpack: Bundler = {\n name: bundlerName,\n version: runWebpack.version,\n bundle: async function (options, context) {\n const { errors, newEntries } = await writeESMStubsInWorker(options);\n if (errors?.length) {\n return { errors };\n }\n\n const outputPath = options.outputPath ?? options.inputPath;\n\n const defaultExtensionsToInline = [...base64AssetExtensions];\n const { unsafeDisableInlineSvg = false } = options.bundlerOptions || {};\n // TODO: This will be deleted in the upcoming PRs\n if (!unsafeDisableInlineSvg) {\n defaultExtensionsToInline.push('.svg');\n }\n\n const bundlerCapabilitiesOptions: BundlerCapabilitiesOptions = {\n // Enable asset-inline by default for common image types\n 'asset-inline': { extensions: defaultExtensionsToInline },\n ...(options.bundlerCapabilities || {}),\n } satisfies InternalBundlerCapabilitiesOptions;\n\n const config = await processCapabilities<WebpackCapabilityConfig>({\n bundlerName,\n baseConfig: getWebpackConfiguration({ options, outputPath, newEntries }, context),\n bundlerCapabilitiesOptions,\n internalCapabilities: webpackCapabilities,\n bundlerCapabilitiesRegistry: context.config.bundlerCapabilitiesRegistry,\n });\n\n try {\n const stats = await new Promise<Stats | undefined>((resolve, reject) => {\n runWebpack(config, (err, statsResult) => (err ? reject(err) : resolve(statsResult)));\n });\n\n // Normalize the output outside the callback, so if there's an exception it's not swallowed\n return normalizeWebpackOutput({ stats, config, outputPath, options });\n } catch (err) {\n const errorMessage: BundleMessage = { text: (err as Error).message || String(err), source: bundlerName };\n if (err instanceof Error && err.stack) {\n // remove the message from the stack\n errorMessage.notes = [{ text: err.stack.includes(err.message) ? err.stack.split(err.message)[1] : err.stack }];\n }\n return {\n errors: [errorMessage],\n rawInput: config as Record<string, unknown>,\n };\n }\n },\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundler-webpack",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Cloudpack's wrapper for the Webpack bundler",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,13 +13,23 @@
13
13
  "import": "./lib/index.js"
14
14
  }
15
15
  },
16
+ "scripts": {
17
+ "api": "cloudpack-scripts api",
18
+ "build:watch": "cloudpack-scripts build-watch",
19
+ "build": "cloudpack-scripts build",
20
+ "lint:update": "cloudpack-scripts lint-update",
21
+ "lint": "cloudpack-scripts lint",
22
+ "test:update": "cloudpack-scripts test-update",
23
+ "test:watch": "cloudpack-scripts test-watch",
24
+ "test": "cloudpack-scripts test"
25
+ },
16
26
  "dependencies": {
17
27
  "@ms-cloudpack/bundler-capabilities": "^0.4.8",
18
- "@ms-cloudpack/bundler-utilities": "^0.7.2",
19
- "@ms-cloudpack/common-types": "^0.32.2",
20
- "@ms-cloudpack/esm-stub-utilities": "^0.15.30",
28
+ "@ms-cloudpack/bundler-utilities": "^0.7.3",
29
+ "@ms-cloudpack/common-types": "^0.33.0",
30
+ "@ms-cloudpack/esm-stub-utilities": "^0.15.33",
21
31
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
22
- "@ms-cloudpack/path-utilities": "^3.1.34",
32
+ "@ms-cloudpack/path-utilities": "^3.2.0",
23
33
  "@swc/core": "^1.3.0",
24
34
  "@swc/plugin-relay": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0",
25
35
  "css-loader": "^7.0.0",
@@ -40,16 +50,6 @@
40
50
  "@ms-cloudpack/scripts": "^0.0.1",
41
51
  "@ms-cloudpack/test-utilities": "^0.5.0"
42
52
  },
43
- "scripts": {
44
- "api": "cloudpack-scripts api",
45
- "build:watch": "cloudpack-scripts build-watch",
46
- "build": "cloudpack-scripts build",
47
- "lint:update": "cloudpack-scripts lint-update",
48
- "lint": "cloudpack-scripts lint",
49
- "test:update": "cloudpack-scripts test-update",
50
- "test:watch": "cloudpack-scripts test-watch",
51
- "test": "cloudpack-scripts test"
52
- },
53
53
  "files": [
54
54
  "lib/**/!(*.test.*)"
55
55
  ]