csstools / postcss-normalize

Use the parts of normalize.css (or sanitize.css) you need from your browserslist
Creative Commons Zero v1.0 Universal
816 stars 40 forks source link

postcss-import config missing options #49

Open Yimiprod opened 4 years ago

Yimiprod commented 4 years ago

In the config object of postcss-import, there's a path option to define where it has to search for a file.

at the moment the only way is to create a resolve function:

const path = require('path');
const atImport = require('postcss-import');
const postcssNormalize = require('postcss-normalize');

module.exports = {
// [...]
  plugins: [
    atImport(postcssNormalize(/* opts */).postcssImport({
        resolve: (id) => path.resolve(__dirname, 'path/to/css', `${id}.css`),
    })),
  ],
};

but we could be allowed to use options.path

const atImport = require('postcss-import');
const postcssNormalize = require('postcss-normalize');

module.exports = {
// [...]
  plugins: [
    atImport(postcssNormalize(/* opts */).postcssImport({
      path: 'path/to/css',
    })),
  ],
};