1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-29 00:57:50 +02:00
market/next.config.js
mihaisc 8d1782a800
Restore order (#1068)
* minor refactors

* minor refactors

* fixes

* buy dt

* consumePrice + estimation

* various fixes

* cleanup

* fix build

* fix ssh issue

* feedback

* build fix

* ssh fix

* remove console.log

* suggested fixes

* other fixes

* switch to decimal

* more fixes

* more fixes

* fix

* some fee refactors

* more fee refactoring

* lib update, fre rename

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>

* minor refactors

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>

* build fixes

Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>

* update + more refactoring

* calc price

* fix build

* restore accountId in effect

* fix order

* fix build and update lib

* fix order index

* fix comments

* pool fix

* remove console.log

* fix order fixed rate exchange

* fixed free order and messaging

* add comment

* minor type fix

* more type fixes
2022-02-14 08:27:36 -08:00

61 lines
1.8 KiB
JavaScript

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
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,
assert: 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
}
// Prefer loading of ES Modules over CommonJS
// https://nextjs.org/blog/next-11-1#es-modules-support
// experimental: { esmExternals: true }
}
return nextConfig
}