Skip to content

Commit

Permalink
Add postcss-import settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed Oct 7, 2020
1 parent 4658d45 commit 0510096
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
19 changes: 19 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions support/package.json
Expand Up @@ -24,6 +24,7 @@
"lodash.groupby": "^4.6.0",
"lodash.isequal": "^4.5.0",
"postcss": "^7.0.34",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-nested": "^4.2.3",
"type-fest": "^0.17.0",
Expand Down
6 changes: 5 additions & 1 deletion support/scripts/linaria.js
Expand Up @@ -16,6 +16,7 @@ const chalk = require('chalk');
const { baseDir } = require('./helpers');
const prettier = require('prettier');
const postcssNested = require('postcss-nested');
const postcssImport = require('postcss-import');
const autoprefixer = require('autoprefixer');
const postcss = require('postcss');
const { camelCase, pascalCase } = require('case-anything');
Expand Down Expand Up @@ -113,7 +114,10 @@ async function formatContents(contents, parser = 'css') {
* @param {string?} [to] - the output path for the transformation
*/
async function processCss(css, from, to) {
const result = await postcss([postcssNested, autoprefixer]).process(css, { from, to });
const result = await postcss([postcssImport, postcssNested, autoprefixer]).process(css, {
from,
to,
});
return result.css;
}

Expand Down
2 changes: 1 addition & 1 deletion support/website/plugins/monaco-editor.js
Expand Up @@ -36,7 +36,7 @@ function monacoEditorPlugin(_context, _options) {
}

item.options.plugins = () => {
return [require('postcss-nested'), require('autoprefixer')];
return [require('postcss-import'), require('postcss-nested'), require('autoprefixer')];
};
}
}
Expand Down

0 comments on commit 0510096

Please sign in to comment.