@ms-cloudpack/bundler-webpack 0.2.17 → 0.2.19

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.
@@ -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,OAkDrB,CAAC"}
1
+ {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA6C,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAWrG,eAAO,MAAM,OAAO,EAAE,OAoDrB,CAAC"}
package/lib/webpack.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { processCapabilities } from '@ms-cloudpack/bundler-capabilities';
2
2
  import { writeESMStubsInWorker } from '@ms-cloudpack/esm-stub-utilities';
3
3
  import runWebpack from 'webpack';
4
+ import * as webpackExports from 'webpack';
4
5
  import { getWebpackConfiguration } from './getWebpackConfiguration.js';
5
6
  import { normalizeWebpackOutput } from './normalizeWebpackOutput.js';
6
7
  import { webpackCapabilities } from './webpackCapabilities.js';
@@ -8,6 +9,8 @@ import { base64AssetExtensions } from '@ms-cloudpack/bundler-utilities';
8
9
  const bundlerName = 'webpack';
9
10
  export const webpack = {
10
11
  name: bundlerName,
12
+ // The types list this as a named import, but it's not set up properly
13
+ version: webpackExports.version,
11
14
  bundle: async function (options, context) {
12
15
  const { errors, newEntries } = await writeESMStubsInWorker(options);
13
16
  if (errors?.length) {
@@ -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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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 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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AAO,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 * as webpackExports 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 // The types list this as a named import, but it's not set up properly\n version: webpackExports.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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundler-webpack",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "A cloudpack plugin for abstracting webpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,12 +14,12 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@ms-cloudpack/bundler-capabilities": "^0.2.8",
18
- "@ms-cloudpack/bundler-utilities": "^0.1.22",
19
- "@ms-cloudpack/common-types": "^0.24.3",
20
- "@ms-cloudpack/esm-stub-utilities": "^0.14.3",
17
+ "@ms-cloudpack/bundler-capabilities": "^0.2.9",
18
+ "@ms-cloudpack/bundler-utilities": "^0.1.24",
19
+ "@ms-cloudpack/common-types": "^0.24.4",
20
+ "@ms-cloudpack/esm-stub-utilities": "^0.14.5",
21
21
  "@ms-cloudpack/path-string-parsing": "^1.2.6",
22
- "@ms-cloudpack/path-utilities": "^2.8.4",
22
+ "@ms-cloudpack/path-utilities": "^3.0.1",
23
23
  "@swc/core": "^1.3.0",
24
24
  "css-loader": "^6.0.0",
25
25
  "ejs-loader": "^0.5.0",