-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
57 lines (51 loc) · 1.48 KB
/
next.config.js
File metadata and controls
57 lines (51 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import 'dotenv/config';
import createNextIntlPlugin from 'next-intl/plugin';
import path from 'path';
const withNextIntl = createNextIntlPlugin();
import { createRequire } from 'module';
import getEnv from './bin/webpack/env.js';
const require = createRequire(import.meta.url);
const brand = process.env.BRAND || 'default';
const brandPathRelative = `./packages/brand-${brand}/src`;
const brandPathAbsolute = path.resolve(`packages/brand-${brand}/src`);
const cms = (process.env.CMS || 'shopana').toLowerCase();
const relayConfig = require(`./relay.${cms}.json`);
/** @type {import('next').NextConfig} */
const nextConfig = {
env: getEnv(),
reactStrictMode: false,
images: {
// unoptimized: true,
remotePatterns: [
{
protocol: 'https',
hostname: 'nbg1.your-objectstorage.com',
pathname: '/**',
},
],
},
productionBrowserSourceMaps: true,
// Transpile local packages for hot reload during development
transpilePackages: ['@shopana/storefront-sdk'],
compiler: {
styledComponents: true,
...(process.env.STORYBOOK ? {} : { relay: relayConfig }),
},
typescript: {
ignoreBuildErrors: true,
},
turbopack: {
resolveAlias: {
'@shopana/brand': brandPathRelative,
'@shopana/brand/*': `${brandPathRelative}/*`,
},
},
webpack: (config) => {
config.resolve.alias = {
...config.resolve.alias,
'@shopana/brand': brandPathAbsolute,
};
return config;
},
};
export default withNextIntl(nextConfig);