Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 44 additions & 6 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,56 @@
const webpack = require("webpack")

module.exports = {
webpack: function override(webpackConfig) {
webpackConfig.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto",
test: /\.(js|mjs|jsx)$/,
enforce: "pre",
loader: require.resolve("source-map-loader"),
resolve: {
fullySpecified: false,
},
})

// Ignore specific warnings
if (!webpackConfig.ignoreWarnings) {
webpackConfig.ignoreWarnings = []
}

webpackConfig.ignoreWarnings.push(/Failed to parse source map/)

if (!webpackConfig.resolve.fallback) {
webpackConfig.resolve.fallback = {}
}

webpackConfig.resolve = {
...webpackConfig.resolve, // Spread in existing resolve config
fallback: {
...webpackConfig.resolve.fallback, // Spread in existing fallback config if any
crypto: false,
buffer: require.resolve("buffer/"),
assert: false,
http: false,
https: false,
os: false,
url: false,
zlib: false,
stream: require.resolve("stream-browserify"),
},
}

// Provide Plugin to make Buffer globally available in your app
webpackConfig.plugins = (webpackConfig.plugins || []).concat([
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
process: "process/browser",
}),
])

return webpackConfig
},
devServer: function (configDevServer) {
return function (proxy, allowedHosts) {
const config = configDevServer(proxy, allowedHosts)
return config
// return { ...config, public: "wallet.end-labs.local" }
return configDevServer(proxy, allowedHosts)
}
},
}
Loading