@dr.pogodin/react-utils 1.47.0-alpha.4 → 1.47.0-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.
@@ -30,7 +30,10 @@ function newBaseConfig(options) {
30
30
  './src',
31
31
  ],
32
32
  }],
33
- '@babel/transform-runtime',
33
+ ['@babel/transform-runtime', {
34
+ corejs: 3,
35
+ useESModules: true,
36
+ }],
34
37
  ],
35
38
  presets: [
36
39
  ['@babel/env', {
@@ -18,6 +18,7 @@ const mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plug
18
18
  const webpack_1 = require("webpack");
19
19
  const workbox_webpack_plugin_1 = __importDefault(require("workbox-webpack-plugin"));
20
20
  const utils_1 = require("@dr.pogodin/babel-plugin-react-css-modules/utils");
21
+ const COREJS_REGEX = /\/core-js/;
21
22
  /**
22
23
  * Creates a new Webpack config object, and performs some auxiliary operations
23
24
  * on the way.
@@ -198,8 +199,6 @@ function configFactory(ops) {
198
199
  }
199
200
  /* Entry points normalization. */
200
201
  const entry = [
201
- 'core-js/stable',
202
- 'regenerator-runtime/runtime',
203
202
  'nodelist-foreach-polyfill',
204
203
  ...Array.isArray(o.entry) ? o.entry : [o.entry],
205
204
  ];
@@ -214,6 +213,17 @@ function configFactory(ops) {
214
213
  o.workbox = {};
215
214
  plugins.push(new workbox_webpack_plugin_1.default.InjectManifest(Object.assign(Object.assign({ swSrc: node_path_1.default.resolve(__dirname, '../workbox/default.js') }, o.workbox), { swDest: '__service-worker.js' })));
216
215
  }
216
+ let { babelLoaderExclude } = ops;
217
+ if (babelLoaderExclude) {
218
+ if (!Array.isArray(babelLoaderExclude))
219
+ throw Error('Not supported');
220
+ // BEWARE: This ensures Babel loader does not process CoreJS library,
221
+ // which would break it creating circular references in its code.
222
+ babelLoaderExclude = [...babelLoaderExclude, COREJS_REGEX];
223
+ }
224
+ else {
225
+ babelLoaderExclude = [COREJS_REGEX];
226
+ }
217
227
  const res = {
218
228
  context: o.context,
219
229
  entry,
@@ -235,7 +245,7 @@ function configFactory(ops) {
235
245
  // Loads JS modules (.cjs, .js, .jsx, .mjs); TS modules (.ts, .tsx);
236
246
  // and SVG assets (.svg).
237
247
  test: /\.(cjs|js|jsx|mjs|svg|ts|tsx)$/,
238
- exclude: ops.babelLoaderExclude,
248
+ exclude: babelLoaderExclude,
239
249
  loader: 'babel-loader',
240
250
  options: Object.assign({ babelrc: false, configFile: false, envName: o.babelEnv, presets: [['@dr.pogodin/react-utils/config/babel/webpack', {
241
251
  typescript: ops.typescript,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.47.0-alpha.4",
2
+ "version": "1.47.0-alpha.5",
3
3
  "bin": {
4
4
  "react-utils-build": "bin/build.js",
5
5
  "react-utils-setup": "bin/setup.js"
@@ -8,7 +8,7 @@
8
8
  "url": "https://github.com/birdofpreyru/react-utils/issues"
9
9
  },
10
10
  "dependencies": {
11
- "@babel/runtime": "^7.28.4",
11
+ "@babel/runtime-corejs3": "^7.28.4",
12
12
  "@dr.pogodin/babel-plugin-react-css-modules": "^6.13.8",
13
13
  "@dr.pogodin/csurf": "^1.16.6",
14
14
  "@dr.pogodin/js-utils": "^0.1.4",
@@ -85,7 +85,6 @@
85
85
  "babel-plugin-add-import-extension": "^1.6.0",
86
86
  "babel-plugin-module-resolver": "^5.0.2",
87
87
  "babel-plugin-transform-import-meta": "^2.3.3",
88
- "core-js": "^3.46.0",
89
88
  "css-loader": "^7.1.2",
90
89
  "css-minimizer-webpack-plugin": "^7.0.2",
91
90
  "identity-obj-proxy": "^3.0.0",
@@ -100,7 +99,6 @@
100
99
  "postcss-scss": "^4.0.9",
101
100
  "pretty": "^2.0.0",
102
101
  "react-refresh": "^0.18.0",
103
- "regenerator-runtime": "^0.14.1",
104
102
  "resolve-url-loader": "^5.0.0",
105
103
  "sass": "^1.93.3",
106
104
  "sass-loader": "^16.0.6",