Skip to content
This repository was archived by the owner on Aug 27, 2020. It is now read-only.

Commit ce7ad60

Browse files
author
이봉균
committed
fix next.config.js
1 parent 96ff015 commit ce7ad60

File tree

1 file changed

+26
-32
lines changed

1 file changed

+26
-32
lines changed

next.config.js

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
1+
const path = require('path')
2+
const trash = require('trash')
13
const {exportPathMap} = require('nextjs-export-path-map')
2-
const trash = require('trash')
34

45
module.exports = {
5-
webpack(config) {
6-
if (process.env.ANALYZE) {
7-
config.plugins.push(new BundleAnalyzerPlugin({
8-
analyzerMode: 'server',
9-
analyzerPort: 8888,
10-
openAnalyzer: true
11-
}))
6+
webpack(config) {
7+
if (process.env.ANALYZE) {
8+
config.plugins.push(new BundleAnalyzerPlugin({
9+
analyzerMode: 'server', analyzerPort: 8888, openAnalyzer: true
10+
}))
11+
}
12+
config.module.rules.push({
13+
test: /\.p?css$/, use: [
14+
{
15+
loader: 'emit-file-loader', options: {
16+
name: 'dist/[path][name].[ext]'
1217
}
13-
config.module.rules.push({
14-
test: /\.p?css$/,
15-
use: [
16-
{
17-
loader: 'emit-file-loader',
18-
options: {
19-
name: 'dist/[path][name].[ext]'
20-
}
21-
},
22-
{
23-
loader: 'skeleton-loader',
24-
options: {
25-
procedure : function (stylesheet) {
26-
trash(this._module.userRequest + '.json')
27-
return 'exports.default = \'' + stylesheet + '\';'
28-
}, cacheable: false
29-
}
30-
},
31-
'postcss-loader'
32-
]
33-
})
34-
return config
35-
},
36-
exportPathMap: exportPathMap.bind(null, path.join(__dirname, 'pages'))
18+
}, {
19+
loader: 'skeleton-loader', options: {
20+
procedure : function (stylesheet) {
21+
trash(this._module.userRequest + '.json')
22+
return 'exports.default = \'' + stylesheet + '\';'
23+
}, cacheable: false
24+
}
25+
}, 'postcss-loader'
26+
]
27+
})
28+
return config
29+
},
30+
exportPathMap: exportPathMap.bind(null, path.join(__dirname, 'pages'))
3731
}

0 commit comments

Comments
 (0)