forked from oacore/about
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
53 lines (48 loc) · 1.23 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
const path = require('path')
const withCss = require('@zeit/next-css')
const withSass = require('@zeit/next-sass')
const withImages = require('next-images')
const nextConfig = {
webpack: config => {
Object.assign(config.resolve.alias, {
components: path.resolve(__dirname, 'components'),
data: path.resolve(__dirname, 'data'),
})
config.module.rules.push(
{
test: /\.ya?ml$/,
include: [path.resolve(__dirname, 'data')],
use: [
'json-loader',
path.resolve('webpack/data-loader.js'),
{
loader: 'yaml-import-loader',
options: {
output: 'json',
importRawKeyword: 'file',
},
},
],
},
{
test: /\.ya?ml$/,
exclude: [path.resolve(__dirname, 'data')],
use: {
loader: 'yaml-import-loader',
options: {
importNested: false,
},
},
},
{
test: /\.md$/,
use: ['json-loader', 'yaml-frontmatter-loader'],
}
)
return config
},
sassLoaderOptions: {
includePaths: [path.resolve(__dirname, 'node_modules')],
},
}
module.exports = withImages(withSass(withCss(nextConfig)))