1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00
market/next.config.js

72 lines
2.0 KiB
JavaScript
Raw Normal View History

module.exports = (phase, { defaultConfig }) => {
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
webpack: (config, options) => {
config.module.rules.push(
{
test: /\.svg$/,
issuer: /\.(tsx|ts)$/,
use: [{ loader: '@svgr/webpack', options: { icon: true } }]
},
{
test: /\.gif$/,
// yay for webpack 5
// https://webpack.js.org/guides/asset-management/#loading-images
type: 'asset/resource'
}
)
// for old ocean.js, most likely can be removed later on
2022-01-11 10:45:15 +01:00
config.plugins.push(
new options.webpack.IgnorePlugin({
resourceRegExp: /^electron$/
})
)
const fallback = config.resolve.fallback || {}
Object.assign(fallback, {
// crypto: require.resolve('crypto-browserify'),
// stream: require.resolve('stream-browserify'),
// assert: require.resolve('assert'),
// os: require.resolve('os-browserify'),
// url: require.resolve('url'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
fs: false,
crypto: false,
os: false,
stream: false,
Feature/wagmi (#1912) * wagmi + ethers + web3modal setup * refactor wallet components * fallback providers, more config * kick out useWeb3 * remove all useWeb3 imports * more web3.js usage removal * isAddress utils replacement * restore add token / add network * less accountId changes * web3 legacy tinkering, utils/web3 → utils/wallet * legacy web3 object for ocean.js * graph sync fix, remove custom network switching code * package updates, merge fixes * downgrade to ethers v5 * fix project id * switch to ConnectKit * connectkit theming * add existing chains to wagmi * rewrite getPaymentCollector() * kick out getPaymentCollector completely, use wagmi hooks instead * Revert "kick out getPaymentCollector completely, use wagmi hooks instead" This reverts commit 54c7d1ef1a2dec0b1575a685125ba78336b30f59. * switch getPaymentCollector * calcBaseInGivenDatatokensOut reorg * wip integrate ocean lib 3.0.0 * update orbis components to use wagmi instead of web hooks * more oceanjs integration updates * more refactors * fix build * update ocean lib * fix publish * fix order fixed rate * remove logs * debug and stop infinite cycle orbis connect * fix orbis dm connection * mock use network and fix some more tests * mock wagmi switch network * mock wagmi useProvider createClient and connectKit getDefaultClient * fix jest tests * try storybook fix * cleanups and bump ocean lib * fix order * bump lib to next.5 and add more modal style * bump ocean.js lib to 3.0.0 --------- Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
2023-05-29 12:28:41 +02:00
assert: false,
tls: false,
net: false
})
config.resolve.fallback = fallback
config.plugins = (config.plugins || []).concat([
new options.webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer']
})
])
return typeof defaultConfig.webpack === 'function'
? defaultConfig.webpack(config, options)
: config
},
async redirects() {
return [
{
source: '/publish',
destination: '/publish/1',
permanent: true
}
]
}
// Prefer loading of ES Modules over CommonJS
// https://nextjs.org/blog/next-11-1#es-modules-support
// experimental: { esmExternals: true }
}
return nextConfig
}