This repository has been archived by the owner on Aug 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
이봉균
committed
Oct 8, 2017
1 parent
96ff015
commit ce7ad60
Showing
1 changed file
with
26 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,31 @@ | ||
const path = require('path') | ||
const trash = require('trash') | ||
const {exportPathMap} = require('nextjs-export-path-map') | ||
const trash = require('trash') | ||
|
||
module.exports = { | ||
webpack(config) { | ||
if (process.env.ANALYZE) { | ||
config.plugins.push(new BundleAnalyzerPlugin({ | ||
analyzerMode: 'server', | ||
analyzerPort: 8888, | ||
openAnalyzer: true | ||
})) | ||
webpack(config) { | ||
if (process.env.ANALYZE) { | ||
config.plugins.push(new BundleAnalyzerPlugin({ | ||
analyzerMode: 'server', analyzerPort: 8888, openAnalyzer: true | ||
})) | ||
} | ||
config.module.rules.push({ | ||
test: /\.p?css$/, use: [ | ||
{ | ||
loader: 'emit-file-loader', options: { | ||
name: 'dist/[path][name].[ext]' | ||
} | ||
config.module.rules.push({ | ||
test: /\.p?css$/, | ||
use: [ | ||
{ | ||
loader: 'emit-file-loader', | ||
options: { | ||
name: 'dist/[path][name].[ext]' | ||
} | ||
}, | ||
{ | ||
loader: 'skeleton-loader', | ||
options: { | ||
procedure : function (stylesheet) { | ||
trash(this._module.userRequest + '.json') | ||
return 'exports.default = \'' + stylesheet + '\';' | ||
}, cacheable: false | ||
} | ||
}, | ||
'postcss-loader' | ||
] | ||
}) | ||
return config | ||
}, | ||
exportPathMap: exportPathMap.bind(null, path.join(__dirname, 'pages')) | ||
}, { | ||
loader: 'skeleton-loader', options: { | ||
procedure : function (stylesheet) { | ||
trash(this._module.userRequest + '.json') | ||
return 'exports.default = \'' + stylesheet + '\';' | ||
}, cacheable: false | ||
} | ||
}, 'postcss-loader' | ||
] | ||
}) | ||
return config | ||
}, | ||
exportPathMap: exportPathMap.bind(null, path.join(__dirname, 'pages')) | ||
} |