@ms-cloudpack/bundler-webpack 0.3.6 → 0.3.7

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":"webpackCapabilities.d.ts","sourceRoot":"","sources":["../src/webpackCapabilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,mBAAmB,EAAE,wCAAwC,CAAC,aAAa,CAiCvF,CAAC"}
1
+ {"version":3,"file":"webpackCapabilities.d.ts","sourceRoot":"","sources":["../src/webpackCapabilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,eAAO,MAAM,mBAAmB,EAAE,wCAAwC,CAAC,aAAa,CAsCvF,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { webExtensions } from '@ms-cloudpack/bundler-capabilities';
2
+ import webpack from 'webpack';
2
3
  export const webpackCapabilities = {
3
4
  'asset-inline': (config, options) => {
4
5
  // Remove the leading dot from the extensions
@@ -30,6 +31,11 @@ export const webpackCapabilities = {
30
31
  config.resolve.extensions.unshift(...webExtensions);
31
32
  return config;
32
33
  },
34
+ define: (config, options) => {
35
+ config.plugins ??= [];
36
+ config.plugins.push(new webpack.DefinePlugin(options));
37
+ return config;
38
+ },
33
39
  // This is a placeholder for the density capability. It doesn't do anything in the bundler.
34
40
  // It's just a workaround for a post-bundle task. This will be replaced with 'plugins' in the future.
35
41
  density: (config) => config,
@@ -1 +1 @@
1
- {"version":3,"file":"webpackCapabilities.js","sourceRoot":"","sources":["../src/webpackCapabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,C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OAAO,CAAC,UAAU,KAAK,EAAE,CAAC;QACjC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,2FAA2F;IAC3F,qGAAqG;IACrG,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;CAC5B,CAAC","sourcesContent":["import { webExtensions } from '@ms-cloudpack/bundler-capabilities';\nimport type { InternalBundlerCapabilityImplementations } from '@ms-cloudpack/common-types';\nimport type { Configuration } from 'webpack';\n\nexport const webpackCapabilities: InternalBundlerCapabilityImplementations<Configuration> = {\n 'asset-inline': (config, options) => {\n // Remove the leading dot from the extensions\n const extensions = options.extensions.map((ext) => (ext.startsWith('.') ? ext.slice(1) : ext));\n config.module ??= {};\n config.module.rules ??= [];\n config.module.rules.push({\n test: new RegExp(`\\\\.(${extensions.join('|')})$`, 'i'),\n type: 'asset/inline',\n });\n return config;\n },\n alias: (config, options) => {\n // Add aliases for externalized packages to the webpack configuration\n if (!config.externals) {\n config.externals = [];\n } else if (!Array.isArray(config.externals)) {\n config.externals = [config.externals];\n }\n // The aliased packaged must be the first element in the array,\n // so that it is resolved before all other packages are externalized.\n config.externals.unshift(options);\n return config;\n },\n 'resolve-web-extensions': (config) => {\n config.resolve ??= {};\n config.resolve.extensions ??= [];\n config.resolve.extensions.unshift(...webExtensions);\n return config;\n },\n // This is a placeholder for the density capability. It doesn't do anything in the bundler.\n // It's just a workaround for a post-bundle task. This will be replaced with 'plugins' in the future.\n density: (config) => config,\n};\n"]}
1
+ {"version":3,"file":"webpackCapabilities.js","sourceRoot":"","sources":["../src/webpackCapabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,MAAM,mBAAmB,GAA4D;IAC1F,cAAc,EAAE,CAAC,MAAM,EAAE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AO,CAAC,GAAG,aAAa,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;QAC1B,MAAM,CAAC,OAAO,KAAK,EAAE,CAAC;QACtB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;QACvD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,2FAA2F;IAC3F,qGAAqG;IACrG,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;CAC5B,CAAC","sourcesContent":["import { webExtensions } from '@ms-cloudpack/bundler-capabilities';\nimport type { InternalBundlerCapabilityImplementations } from '@ms-cloudpack/common-types';\nimport type { Configuration } from 'webpack';\nimport webpack from 'webpack';\n\nexport const webpackCapabilities: InternalBundlerCapabilityImplementations<Configuration> = {\n 'asset-inline': (config, options) => {\n // Remove the leading dot from the extensions\n const extensions = options.extensions.map((ext) => (ext.startsWith('.') ? ext.slice(1) : ext));\n config.module ??= {};\n config.module.rules ??= [];\n config.module.rules.push({\n test: new RegExp(`\\\\.(${extensions.join('|')})$`, 'i'),\n type: 'asset/inline',\n });\n return config;\n },\n alias: (config, options) => {\n // Add aliases for externalized packages to the webpack configuration\n if (!config.externals) {\n config.externals = [];\n } else if (!Array.isArray(config.externals)) {\n config.externals = [config.externals];\n }\n // The aliased packaged must be the first element in the array,\n // so that it is resolved before all other packages are externalized.\n config.externals.unshift(options);\n return config;\n },\n 'resolve-web-extensions': (config) => {\n config.resolve ??= {};\n config.resolve.extensions ??= [];\n config.resolve.extensions.unshift(...webExtensions);\n return config;\n },\n define: (config, options) => {\n config.plugins ??= [];\n config.plugins.push(new webpack.DefinePlugin(options));\n return config;\n },\n // This is a placeholder for the density capability. It doesn't do anything in the bundler.\n // It's just a workaround for a post-bundle task. This will be replaced with 'plugins' in the future.\n density: (config) => config,\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundler-webpack",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
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.39",
18
- "@ms-cloudpack/bundler-utilities": "^0.5.6",
19
- "@ms-cloudpack/common-types": "^0.27.4",
20
- "@ms-cloudpack/esm-stub-utilities": "^0.15.12",
17
+ "@ms-cloudpack/bundler-capabilities": "^0.3.0",
18
+ "@ms-cloudpack/bundler-utilities": "^0.5.7",
19
+ "@ms-cloudpack/common-types": "^0.27.5",
20
+ "@ms-cloudpack/esm-stub-utilities": "^0.15.13",
21
21
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
22
- "@ms-cloudpack/path-utilities": "^3.1.19",
22
+ "@ms-cloudpack/path-utilities": "^3.1.20",
23
23
  "@swc/core": "^1.3.0",
24
24
  "css-loader": "^7.0.0",
25
25
  "ejs-loader": "^0.5.0",