-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
69 lines (67 loc) · 2.01 KB
/
next.config.js
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
58
59
60
61
62
63
64
65
66
67
68
69
require("dotenv").config();
const path = require("path");
const withSass = require("@zeit/next-sass");
const rtlcss = require("rtlcss");
module.exports = withSass({
assetPrefix: process.env.ASSET_PREFIX || "/random-ibm/",
basePath: process.env.BASE_PATH || "",
env: {
ALTLANG_ROOT_PATH: process.env.ALTLANG_ROOT_PATH || "/",
KALTURA_PARTNER_ID: process.env.KALTURA_PARTNER_ID || "1773841",
KALTURA_UICONF_ID: process.env.KALTURA_UICONF_ID || "27941801",
DDS_CALLOUT_DATA: process.env.DDS_CALLOUT_DATA || "false",
ENABLE_RTL: process.env.ENABLE_RTL || "false",
},
sassLoaderOptions: {
sassOptions: {
includePaths: [path.resolve(__dirname, "node_modules")],
},
},
webpack: (config) => {
config.module.rules.push({
test: /\.scss$/,
sideEffects: true,
use: [
{
loader: "postcss-loader",
options: {
plugins: () => {
const autoPrefixer = require("autoprefixer")({
overrideBrowserslist: ["last 1 version", "ie >= 11"],
});
return process.env.ENABLE_RTL === "true"
? [autoPrefixer, rtlcss]
: [autoPrefixer];
},
},
},
{
loader:
process.env.NODE_ENV === "production"
? "sass-loader"
: "fast-sass-loader",
options: Object.assign(
process.env.NODE_ENV === "production"
? {
sassOptions: {
includePaths: [path.resolve(__dirname, "node_modules")],
},
}
: {
includePaths: [path.resolve(__dirname, "node_modules")],
},
{
additionalData: `
$feature-flags: (
enable-css-custom-properties: true
);
`,
sourceMap: process.env.NODE_ENV !== "production",
}
),
},
],
});
return config;
},
});