-
Notifications
You must be signed in to change notification settings - Fork 6
/
next.config.js
77 lines (72 loc) · 2.06 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
70
71
72
73
74
75
76
77
const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');
const CopyPlugin = require('copy-webpack-plugin');
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
eslint: {
ignoreDuringBuilds: true,
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
pathname: '/a/*',
},
],
},
webpack: (config, { webpack }) => {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
'react-native-sqlite-storage': false,
};
config.ignoreWarnings = [
{ module: /node_modules\/typeorm\/util\/ImportUtils\.js/ },
{ module: /node_modules\/typeorm\/util\/DirectoryExportedClassesLoader\.js/ },
{ module: /node_modules\/typeorm\/platform\/PlatformTools\.js/ },
{ module: /node_modules\/typeorm\/connection\/ConnectionOptionsReader\.js/ },
{ module: /node_modules\/app-root-path\/lib\/app-root-path\.js/ },
];
config.plugins = [
...config.plugins,
// Copies the wasm file required for sql.js into the public directory so it
// is accessible
new CopyPlugin({
patterns: [{
from: require.resolve('sql.js/dist/sql-wasm.wasm'),
to: '../public/',
}],
}),
// This helps typeorm find sql.js driver. If we remove this then we
// need to pass the driver in datasource initialization.
new webpack.ProvidePlugin({
'window.SQL': 'sql.js/dist/sql-wasm.js'
}),
new FilterWarningsPlugin({
exclude: [
/aws-crt/,
/mongodb/,
/encoding/,
/mssql/,
/mysql/,
/mysql2/,
/oracledb/,
/pg/,
/pg-native/,
/pg-query-stream/,
/react-native-sqlite-storage/,
/redis/,
/sqlite3/,
/sql.js/,
/typeorm-aurora-data-api-driver/,
/hdb-pool/,
/spanner/,
/hana-client/,
],
}),
];
return config;
},
}
module.exports = nextConfig