manifold/web/next.config.js
Marshall Polaris 47f10301c8
Change lodash stuff so that it can be tree-shaken out of build (#233)
* Set common package.json sideEffects: false

* Configure SWC to modularize lodash imports

* Import specific lodash functions instead of _

* Add an eslint rule to avoid full lodash import
2022-05-22 01:36:05 -07:00

33 lines
640 B
JavaScript

const API_DOCS_URL = 'https://docs.manifold.markets/api'
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
experimental: {
externalDir: true,
optimizeCss: true,
modularizeImports: {
lodash: {
transform: 'lodash/{{member}}',
},
},
},
images: {
domains: ['lh3.googleusercontent.com', 'i.imgur.com'],
},
async redirects() {
return [
{
source: '/api',
destination: API_DOCS_URL,
permanent: false,
},
{
source: '/api/v0',
destination: API_DOCS_URL,
permanent: false,
},
]
},
}