Skip to content

Commit

Permalink
Don't load PostCSS and PostHTML config when inside node_modules (#7088)
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Oct 14, 2021
1 parent 84da50a commit 674539e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/transformers/postcss/src/loadConfig.js
Expand Up @@ -104,6 +104,10 @@ export async function load({
options: PluginOptions,
logger: PluginLogger,
|}): Promise<?ConfigResult> {
if (!config.isSource) {
return;
}

let configFile: any = await config.getConfig(
['.postcssrc', '.postcssrc.json', '.postcssrc.js', 'postcss.config.js'],
{packageKey: 'postcss'},
Expand Down
4 changes: 4 additions & 0 deletions packages/transformers/posthtml/src/PostHTMLTransformer.js
Expand Up @@ -13,6 +13,10 @@ import loadPlugins from './loadPlugins';

export default (new Transformer({
async loadConfig({config, options, logger}) {
if (!config.isSource) {
return;
}

let configFile = await config.getConfig(
['.posthtmlrc', '.posthtmlrc.js', 'posthtml.config.js'],
{
Expand Down

0 comments on commit 674539e

Please sign in to comment.