forked from perufork/elliot-serverless-ecommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
41 lines (40 loc) · 853 Bytes
/
Copy pathnext.config.js
File metadata and controls
41 lines (40 loc) · 853 Bytes
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
const path = require("path");
const withImages = require("next-images");
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`
});
module.exports = withImages({
env: {
BASE_URL: process.env.BASE_URL,
ELLIOT_ENV_VARIABLES: process.env.ELLIOT_ENV_VARIABLES,
ENVIRONMENT: process.env.ENVIRONMENT
},
webpack: (config, { isServer }) => {
if (config.resolve.modules)
config.resolve.modules.unshift(path.resolve(__dirname, "src"));
if (isServer) {
// we're in build mode so enable fs caching for data
process.env.USE_BUILD_CACHE = "true";
}
return config;
},
experimental: {
async rewrites() {
return [
{
source: "/",
destination: "/index.html"
}
];
},
async redirects() {
return [
{
source: "/:path+/",
destination: "/:path+",
permanent: false
}
];
}
}
});