Files
TheGame/packages/web/next.config.js
δυς 9e37df6207 Update MyMeta to ECMAScript Modules + Switch to DID:PKH (#1429)
* beginning ESM transition: Ceramic libraries, Next.js, & TypeScript configuration 🇭🇰

* updating Chakra, React, & Next image `import`s 👔

* upgrading `@types/react`, import extensions for Node, & b64 SVG to PNG ⛹🏿‍♀️

* fixing relative import names & upddating @types packages 📻

* removoing WYSIWYG editor, draft-js, & updating express ⛹🏿‍♀️

* updating OpenSea 🚲

* ¡@metafam/utils is building! 📰

* ¡Discord bot is building! 👘

* ¡backend is building! 🛩

* fixed everything but Ceramic DID update 🏍

* switching to DID:PKH 📦

* fixing "only one child allowed" error 🙇🏿‍♀️

* importing `React` as required by tsc's `isolatedModules` 🇲🇰

* disabling testing rather than taking the time to fix jest ⚜

* removing set `types` from `tsconfig` to fix compilation error 🥦

* printing tests disabled warning, hopefully 🙀

* setting file to be copied to the new resolver 👁️‍🗨️

* "paths-resolver" not "paths-resolve" 🦴

* switching back to relative paths rather than trying to fix `paths` 

* `yarn backend:dev` not working, testing GitHub build 🎺

* removing design system build & fixing some images ✊🏿

* fixed "expected function got string" error & trying to address undefined HTMLElement 🐡

* fixing @emotion/react tree shaking by making external 🏏

* including eslint config in Dockerfile 🌾

* fixing more images 🎯

* updating DIDs & switching back to an updated DID:3 ❇

* switching to w3s.link gateway & fixing early termination of storage endpoint 🔭

* switching back to ipfs.io gateway b/c w3s.link serves SVGs as application/xml which are CORB blocked 🥾

* fixing node config name in eslint ignore & shortening some paths 🧰

* fixing ts-node not handling project references 🥁
2022-11-14 11:26:41 -05:00

114 lines
2.9 KiB
JavaScript

import HoneybadgerSourceMapPlugin from '@honeybadger-io/webpack';
import { execSync } from 'child_process';
const { HONEYBADGER_API_KEY, HONEYBADGER_ASSETS_URL } = process.env;
/**
* TODO: needs to get revision from the build but is currently breaking the build.
* I don't wanna delay the release of #1414 so perhaps an improvement idea?
*/
// const HONEYBADGER_REVISION = execSync('git rev-parse HEAD').toString().trim();
export default {
async redirects() {
return [
{
source: '/community/join/patrons',
destination: '/join/patron',
permanent: false,
},
{
source: '/community/players',
destination: '/players',
permanent: false,
},
{
source: '/community/patrons',
destination: '/patrons',
permanent: false,
},
{
source: '/community/guilds',
destination: '/guilds',
permanent: false,
},
{
source: '/profile/setup',
destination: '/profile/setup/name',
permanent: false,
},
{
source: '/profile/setup/username',
destination: '/profile/setup/name',
permanent: false,
},
{
source: '/join',
destination: '/profile/setup',
permanent: false,
},
{
source: '/done',
destination: '/profile/setup/complete',
permanent: false,
},
];
},
async rewrites() {
return [
{
source: '/metagame/feed',
destination: 'https://metagame.substack.com/feed',
},
];
},
productionBrowserSourceMaps: true,
env: {
HONEYBADGER_API_KEY,
},
webpack: (config, { isServer, webpack }) => {
if (!isServer) {
config.plugins.push(
// jsdom is required for draft-js SSR only
new webpack.IgnorePlugin({ resourceRegExp: /jsdom$/ }),
);
// config.resolve.fallback = {
// fs: false,
// net: false,
// http: require.resolve('stream-http'),
// os: require.resolve('os-browserify/browser'),
// https: require.resolve('https-browserify'),
// child_process: false,
// stream: require.resolve('stream-browserify'),
// 'browserify-zlib': false,
// zlib: false,
// crypto: require.resolve('crypto-browserify'),
// path: false,
// tls: false,
// };
/**
* For uploading sourcemaps for Honeybadger.
*/
// if (HONEYBADGER_API_KEY && HONEYBADGER_ASSETS_URL) {
// config.devtool = 'hidden-source-map';
// config.plugins.push(
// new HoneybadgerSourceMapPlugin({
// apiKey: HONEYBADGER_API_KEY,
// assetsUrl: HONEYBADGER_ASSETS_URL,
// revision: HONEYBADGER_REVISION,
// }),
// );
// }
}
// config.plugins.push(
// new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }),
// );
return config;
},
};