stargaze-studio/next.config.js
2022-12-13 15:52:43 +03:00

38 lines
884 B
JavaScript

// @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,
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