-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnext.config.js
More file actions
61 lines (54 loc) · 1.54 KB
/
next.config.js
File metadata and controls
61 lines (54 loc) · 1.54 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
/** @type {import('next').NextConfig} */
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const nextConfig = {
output: 'export',
trailingSlash: true,
skipTrailingSlashRedirect: true,
distDir: 'out',
images: {
unoptimized: true
},
typescript: {
ignoreBuildErrors: false,
},
eslint: {
ignoreDuringBuilds: false,
},
sassOptions: {
includePaths: ['./src/styles'],
},
// Basitleştirilmiş webpack konfigürasyonu
webpack: (config, { isServer }) => {
// CSS modülleri için basit ayarlar
if (!isServer) {
// MiniCssExtractPlugin'i ekle
config.plugins.push(
new MiniCssExtractPlugin({
filename: 'static/css/[name].[contenthash:8].css',
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
})
);
}
// CSS dosyalarını işlemek için kurallar
const cssRules = config.module.rules.find(rule => typeof rule.oneOf === 'object');
if (cssRules) {
// CSS modüllerini etkinleştir
const moduleSassRule = cssRules.oneOf.find(
rule => rule.test && rule.test.toString().includes('module')
);
if (moduleSassRule) {
const cssLoader = moduleSassRule.use.find(
({ loader }) => loader && loader.includes('css-loader')
);
if (cssLoader) {
cssLoader.options.modules = {
...cssLoader.options.modules,
exportLocalsConvention: 'camelCase',
};
}
}
}
return config;
}
}
module.exports = nextConfig