mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Upgrade to latest node-fetch
- Introduce injection tokens for retriving the implementation of node-fetch via await import() calls - Add webpack file for compiling node-fetch to electron-renderer single file format Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
cd6df109aa
commit
a9134c30c3
25 files changed
+514
-246
No files matched your search
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import path from "path";
|
||||
|
||||
export default {
|
||||
entry: "./node_modules/node-fetch/src/index.js",
|
||||
output: {
|
||||
library: {
|
||||
type: "module",
|
||||
},
|
||||
path: path.resolve(__dirname, "..", "build", "webpack"),
|
||||
filename: "node-fetch.bundle.js",
|
||||
module: true,
|
||||
clean: true,
|
||||
asyncChunks: false, // This is required so that only one file is created
|
||||
},
|
||||
experiments: {
|
||||
outputModule: true,
|
||||
},
|
||||
mode: "production",
|
||||
target: "electron-renderer",
|
||||
optimization: {
|
||||
concatenateModules: true,
|
||||
minimize: true,
|
||||
},
|
||||
externals: {
|
||||
"node:buffer": "commonjs node:buffer",
|
||||
buffer: "commonjs node:buffer",
|
||||
worker_threads: "commonjs node:worker_threads",
|
||||
"node:fs": "commonjs node:fs",
|
||||
"node:https": "commonjs node:https",
|
||||
"node:http": "commonjs node:http",
|
||||
"node:net": "commonjs node:net",
|
||||
"node:path": "commonjs node:path",
|
||||
"node:process": "commonjs node:process",
|
||||
"node:stream/web": "commonjs node:stream/web",
|
||||
"node:stream": "commonjs node:stream",
|
||||
"node:url": "commonjs node:url",
|
||||
"node:util": "commonjs node:util",
|
||||
"node:zlib": "commonjs node:zlib",
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".js"],
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user