Skip to content

Commit 1e8203c

Browse files
sainthkhai
authored andcommitted
New PR that meets the convention. (webpack-contrib#145)
* You can now set custom config path. * Fixed the code to meet the convention. * Removed trailing space and added semicolon.
1 parent 16292d5 commit 1e8203c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ module.exports = function (source, map) {
4848
var options = params.plugins || loader.options.postcss;
4949
var pack = params.pack;
5050
var callback = loader.async();
51+
var configPath = params.config ?
52+
path.join(process.cwd(), params.config) : path.dirname(file);
5153

5254
Promise.resolve().then(function () {
5355
if ( typeof options !== 'undefined' ) {
@@ -57,7 +59,7 @@ module.exports = function (source, map) {
5759
throw new Error('PostCSS plugin pack is supported ' +
5860
'only when use plugins in webpack config');
5961
}
60-
return loadConfig({ webpack: loader }, path.dirname(file));
62+
return loadConfig({ webpack: loader }, configPath);
6163
}
6264
}).then(function (config) {
6365
if ( !config ) config = { };

0 commit comments

Comments
 (0)