-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathnext.config.js
More file actions
107 lines (98 loc) · 2.69 KB
/
next.config.js
File metadata and controls
107 lines (98 loc) · 2.69 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
const TerserPlugin = require("terser-webpack-plugin");
const withTM = require("next-transpile-modules")([
// region @editor-app
"@editor-app/live-session",
"@code-editor/preview-pip", // TODO: remove me. this is for development. for production, use npm ver instead.
"@code-editor/devtools",
"@code-editor/canvas",
// -----------------------------
// region @designto-code
"@designto/debugger",
"@grida/builder-config",
"@grida/builder-config-preset",
"@grida/builder-platform-types",
"@designto/code",
"@designto/sanitized",
"@designto/token",
"@designto/flutter",
"@designto/solid-js",
"@designto/web",
"@designto/vanilla",
"@designto/react",
"@designto/react-native",
"@designto/preact",
"@code-features/assets",
"@code-features/module",
"@code-features/documentation",
"@code-features/component",
"@code-features/flags",
// -----------------------------
// reflect-ui ui framework
// @editor-ui ui components
"@editor-ui/editor",
"@editor-ui/hierarchy",
"@editor-ui/spacer",
"@editor-ui/utils",
"@editor-ui/button",
// -----------------------------
// region builders - part of designto-code / coli
// region web builders
"@web-builder/nodejs",
"@web-builder/core",
"@web-builder/module-es",
"@web-builder/module-jsx",
"@web-builder/solid-js",
"@web-builder/vanilla",
"@web-builder/react-core",
"@web-builder/react",
"@web-builder/react-native",
"@web-builder/preact",
"@web-builder/reflect-ui",
"@web-builder/styled",
"@web-builder/styles",
// endregion web builders
// -----------------------------
]);
module.exports = withTM({
webpack: (config) => {
config.module.rules.push({
type: "javascript/auto",
test: /\.mjs$/,
include: /node_modules/,
});
config.resolve.fallback = {
fs: false, // used by handlebars
path: false, // used by handlebars
crypto: false, // or crypto-browserify (used for totp auth)
stream: false, // or stream-browserify (used for totp auth)
};
// -----------------------------
// for @flutter-builder classname issue
config.optimization.minimizer.push(
new TerserPlugin({
parallel: true,
terserOptions: {
// https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions
keep_classnames: true,
},
})
);
// -----------------------------
return config;
},
async redirects() {
return [
{
// typo gaurd
source: "/preference",
destination: "/preferences",
permanent: true,
},
{
source: "/files/:key/:id",
destination: "/files/:key?node=:id",
permanent: false,
},
];
},
});