Skip to content

Commit

Permalink
Properly export plugin function
Browse files Browse the repository at this point in the history
  • Loading branch information
niksy committed Oct 20, 2020
1 parent 8676666 commit a179ebc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased][]

### Changed

- Properly export plugin function
([reference](https://github.com/postcss/postcss/issues/1441))

## [3.0.0][] - 2020-10-07

### Added
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import emMediaQuery from 'em-media-query';

export default (options) => {
const plugin = (options) => {
return {
postcssPlugin: 'postcss-em-media-query',
AtRule: {
Expand All @@ -10,5 +10,6 @@ export default (options) => {
}
};
};
plugin.postcss = true;

export const postcss = true;
export default plugin;
3 changes: 2 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import fn from '../index';

async function runPostcss(file, options) {
const css = await fs.readFile(file, 'utf8');
return postcss([fn(options)]).process(css);
/* eslint-disable no-undefined */
return postcss([fn(options)]).process(css, { from: undefined });
}

async function runTest(testCase, options) {
Expand Down

0 comments on commit a179ebc

Please sign in to comment.