Skip to content

Commit 2cd7614

Browse files
refactor: code (#451)
1 parent 60e4f12 commit 2cd7614

23 files changed

+102
-62
lines changed

src/utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,12 @@ async function loadConfig(config, context, configPath, loaderContext) {
129129
} else {
130130
result = await explorer.search(searchPath);
131131
}
132-
} catch (errorIgnore) {
133-
throw new Error(`No PostCSS Config found in: ${searchPath}`);
132+
} catch (error) {
133+
throw error;
134+
}
135+
136+
if (!result) {
137+
return {};
134138
}
135139

136140
const patchedContext = createContext(context);
File renamed without changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import style from './style.css'
2+
3+
export default style
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import style from './style2.css'
2+
3+
export default style
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: {
3+
'postcss-short': { prefix: 'x' },
4+
'postcss-import': {},
5+
'postcss-nested': {},
6+
}
7+
}

0 commit comments

Comments
 (0)