forked from ShaderFrog/editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
48 lines (42 loc) · 1.28 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
const path = require('path');
/** @type {import('next').NextConfig} */
module.exports = {
// Disable double rendering which causes issues with editor mounting / unmounting
reactStrictMode: false,
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// Allow SVG imports
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
});
config.resolve = {
...config.resolve,
alias: {
...config.resolve.alias,
babylonjs: path.resolve(
__dirname,
'node_modules/babylonjs/babylon.max.js'
),
'babylonjs-loaders': path.resolve(
__dirname,
'node_modules/babylonjs-loaders/babylonjs.loaders.js'
),
},
};
// Hard code the "@shaderfrog/core" npm link'd path so that we can load its
// typescript files directly (aka @shaderfrog/core/src/...)
// config.module.rules = config.module.rules.map((rule) =>
// /\bts\b/.test(rule.test?.toString())
// ? {
// ...rule,
// include: [
// ...rule.include,
// path.resolve(__dirname, '../core-shaderfrog'),
// ],
// }
// : rule
// );
// Important: return the modified config
return config;
},
};