Skip to content

Commit eab41ba

Browse files
fix: use postcss ast only if versions is equals
1 parent f9cc7ba commit eab41ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
stringifyRequest,
1212
} from 'loader-utils';
1313
import postcss from 'postcss';
14+
import postcssPkg from 'postcss/package.json';
1415

1516
import schema from './options.json';
1617
import plugin from './plugin';
@@ -49,7 +50,7 @@ export default function loader(content, map, meta) {
4950
if (meta) {
5051
const { ast } = meta;
5152

52-
if (ast && ast.type === 'postcss') {
53+
if (ast && ast.type === 'postcss' && ast.version === postcssPkg.version) {
5354
// eslint-disable-next-line no-param-reassign
5455
content = ast.root;
5556
}

0 commit comments

Comments
 (0)