-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
66 lines (62 loc) · 2 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
/* eslint-disable */
const withSass = require("@zeit/next-sass");
const withLess = require("@zeit/next-less");
const withCSS = require("@zeit/next-css");
const { modifiedVariables } = require("./constants/theme");
const CopyPlugin = require("copy-webpack-plugin");
const isProd = process.env.NODE_ENV === "production";
// fix: prevents error when .less files are required by node
if (typeof require !== "undefined") {
require.extensions[".less"] = (file) => {};
}
module.exports = withCSS({
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: "[local]___[hash:base64:5]",
},
...withLess(
withSass({
lessLoaderOptions: {
javascriptEnabled: true,
modifyVars: modifiedVariables,
},
typescript: {
ignoreBuildErrors: true,
},
publicRuntimeConfig: {
REMARK_HOST: process.env.REMARK_HOST,
REMARK_SITE_ID: process.env.REMARK_SITE_ID,
REMARK_LOCALE: process.env.REMARK_LOCALE,
firebaseConfig: {
apiKey: process.env.FIREBASE_API_KEY,
authDomain: process.env.FIREBASE_AUTH_DOMAIN,
databaseURL: process.env.FIREBASE_DB_URL,
projectId: process.env.FIREBASE_PROJECT_ID,
storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.FIREBASE_APP_ID,
measurementId: process.env.FIREBASE_MEASSUREMENT_ID,
},
SITE_URL: process.env.URL,
},
webpack: (config) => {
// Note: we provide webpack above so you should not `require` it
// Perform customizations to webpack config
config.plugins.push(
new CopyPlugin({
patterns: [
{
from: "node_modules/pdfjs-dist/cmaps/",
to: "cmaps/",
},
],
})
);
console.log(config.plugins);
// Important: return the modified config
return config;
},
})
),
});