@umijs/bundler-webpack 4.0.0-canary.20220819.1 → 4.0.0-canary.20220824.1

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.
@@ -36,7 +36,7 @@ async function addAssetRules(opts) {
36
36
  maxSize: inlineLimit
37
37
  }
38
38
  });
39
- const fallback = rule.oneOf("fallback").exclude.add(/^$/).add(/\.(js|mjs|jsx|ts|tsx)$/).add(/\.(css|less|sass|scss|stylus)$/).add(/\.html$/).add(/\.json$/);
39
+ const fallback = rule.oneOf("fallback").exclude.add(/^$/).add(/\.(js|mjs|cjs|jsx|ts|tsx)$/).add(/\.(css|less|sass|scss|stylus)$/).add(/\.html$/).add(/\.json$/);
40
40
  if (userConfig.mdx) {
41
41
  fallback.add(/\.mdx?$/);
42
42
  }
@@ -107,6 +107,7 @@ async function getConfig(opts) {
107
107
  config.resolve.set("symlinks", true).modules.add("node_modules").end().alias.merge(userConfig.alias || {}).end().extensions.merge([
108
108
  ".wasm",
109
109
  ".mjs",
110
+ ".cjs",
110
111
  ".js",
111
112
  ".jsx",
112
113
  ".ts",
@@ -39,12 +39,12 @@ async function addJavaScriptRules(opts) {
39
39
  const useFastRefresh = isDev && userConfig.fastRefresh !== false && name !== import_constants.MFSU_NAME;
40
40
  const depPkgs = Object.assign({}, (0, import_depMatch.es5ImcompatibleVersionsToPkg)());
41
41
  const srcRules = [
42
- config.module.rule("src").test(/\.(js|mjs)$/).include.add([
42
+ config.module.rule("src").test(/\.(js|mjs|cjs)$/).include.add([
43
43
  cwd,
44
44
  ...process.env.APP_ROOT ? [process.cwd()] : []
45
45
  ]).end().exclude.add(/node_modules/).end(),
46
46
  config.module.rule("jsx-ts-tsx").test(/\.(jsx|ts|tsx)$/),
47
- config.module.rule("extra-src").test(/\.(js|mjs)$/).include.add([
47
+ config.module.rule("extra-src").test(/\.(js|mjs|cjs)$/).include.add([
48
48
  ...opts.extraBabelIncludes.map((p) => {
49
49
  if (import_utils.lodash.isRegExp(p)) {
50
50
  return p;
@@ -80,7 +80,7 @@ async function addJavaScriptRules(opts) {
80
80
  srcRules.push(config.module.rule("markdown").test(/\.mdx?$/));
81
81
  }
82
82
  const depRules = [
83
- config.module.rule("dep").test(/\.(js|mjs)$/).include.add(/node_modules/).end().exclude.add((path) => {
83
+ config.module.rule("dep").test(/\.(js|mjs|cjs)$/).include.add(/node_modules/).end().exclude.add((path) => {
84
84
  try {
85
85
  return (0, import_depMatch.isMatch)({ path, pkgs: depPkgs });
86
86
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/bundler-webpack",
3
- "version": "4.0.0-canary.20220819.1",
3
+ "version": "4.0.0-canary.20220824.1",
4
4
  "description": "@umijs/bundler-webpack",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-webpack#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -34,11 +34,11 @@
34
34
  "@svgr/plugin-jsx": "^6.2.1",
35
35
  "@svgr/plugin-svgo": "^6.2.0",
36
36
  "@types/hapi__joi": "17.1.8",
37
- "@umijs/babel-preset-umi": "4.0.0-canary.20220819.1",
38
- "@umijs/bundler-utils": "4.0.0-canary.20220819.1",
37
+ "@umijs/babel-preset-umi": "4.0.0-canary.20220824.1",
38
+ "@umijs/bundler-utils": "4.0.0-canary.20220824.1",
39
39
  "@umijs/case-sensitive-paths-webpack-plugin": "^1.0.1",
40
- "@umijs/mfsu": "4.0.0-canary.20220819.1",
41
- "@umijs/utils": "4.0.0-canary.20220819.1",
40
+ "@umijs/mfsu": "4.0.0-canary.20220824.1",
41
+ "@umijs/utils": "4.0.0-canary.20220824.1",
42
42
  "cors": "^2.8.5",
43
43
  "css-loader": "6.7.1",
44
44
  "es5-imcompatible-versions": "^0.1.73",