-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnext.config.js
75 lines (74 loc) · 1.74 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
const path = require('path')
const { emoteSize } = require('./constants.json')
module.exports = {
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.resolveLoader.modules.push(path.resolve(__dirname, 'src/loaders'))
config.module.rules.push({
test: /.*\.png$/i,
include: /woke-content/,
use: {
loader: 'webpack-image-resize-loader',
options: {
width: emoteSize * 2,
fileLoaderOptions: {
publicPath: '/_next/static/emotes/',
outputPath: 'static/emotes/',
},
},
},
})
config.module.rules.push({
test: /.*\.gif$/i,
include: /woke-content/,
use: [
{
loader: 'file-loader',
options: {
publicPath: '/_next/static/emotes/',
outputPath: 'static/emotes/',
},
},
{
loader: 'resize-gif-loader',
options: {
size: emoteSize * 2,
},
},
],
})
config.module.rules.push({
test: /.*\.mp4$/i,
use: {
loader: 'file-loader',
options: {
publicPath: '/_next/static/',
outputPath: 'static/',
},
},
})
config.module.rules.push({
test: /\.svg$/,
use: [
defaultLoaders.babel,
{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: [
{
cleanupIDs: {
preservePrefixes: ['woke'],
},
},
{
removeViewBox: false,
},
],
},
},
},
],
})
return config
},
}