stargaze-studio/next.config.js

38 lines
884 B
JavaScript
Raw Normal View History

2022-07-13 13:56:36 +00:00
// @ts-check
const packageJson = require('./package.json')
const LOCALHOST_URL = `http://localhost:${process.env.PORT || 3000}`
/**
* @type {import("next").NextConfig}
* @see https://nextjs.org/docs/api-reference/next.config.js/introduction
*/
const nextConfig = {
env: {
APP_VERSION: packageJson.version,
NEXT_PUBLIC_WEBSITE_URL:
process.env.NODE_ENV === 'development' ? LOCALHOST_URL : process.env.NEXT_PUBLIC_WEBSITE_URL,
},
reactStrictMode: false,
2022-07-13 13:56:36 +00:00
trailingSlash: true,
webpack(config, { dev, webpack }) {
// svgr integration
config.module.rules.push({
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
})
// predefined constants
config.plugins.push(
new webpack.DefinePlugin({
__DEV__: dev,
__PROD__: !dev,
}),
)
return config
},
}
module.exports = nextConfig