File: 0005-Port-to-webpack5.patch

package info (click to toggle)
node-envinfo 7.11.0%2B~cs14.3.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,304 kB
  • sloc: javascript: 2,756; makefile: 8
file content (58 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
From: =?utf-8?q?Bastien_Roucari=C3=A8s?= <rouca@debian.org>
Date: Wed, 8 Nov 2023 12:26:00 +0000
Subject: Port to webpack5

forwarded: not-needed
---
 webpack.config.js | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/webpack.config.js b/webpack.config.js
index 4c49213..d2a9d53 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -13,30 +13,38 @@ module.exports = {
     minimize: true,
   },
   output: {
-    libraryTarget: 'commonjs2',
+    libraryTarget: 'commonjs',
     filename: '[name].js',
     path: path.join(__dirname, '/dist'),
   },
   module: {
     rules: [
       {
-        use: 'babel-loader',
         exclude: /(node_modules)/,
         test: /\.js$/,
+        use : {
+          loader : 'babel-loader',
+          options: {
+            presets: [
+              ['@babel/preset-env', { targets: "defaults" , "useBuiltIns": 'usage', "corejs": 3}]
+            ],
+          },
+        },
       },
     ],
   },
-  externals: [/envinfo$/],
+  externals: [
+    /envinfo$/,
+    /^(?!([.][/])?src[/]|[.][.]?[/])/,
+    ],
   plugins: [
     new webpack.BannerPlugin({
-      banner: `#!/usr/bin/env node
-      "use strict"`,
+      banner: '#!/usr/bin/node',
       raw: true,
       include: 'cli',
     }),
     new webpack.DefinePlugin({
       'global.__VERSION__': JSON.stringify(packageJson.version),
     }),
-    new webpack.IgnorePlugin(/spawn-sync/),
   ],
 };