postcss-import-webpack-resolver

1.0.1 • Public • Published

postcss-import-webpack-resolver

This provides a custom css filesystem resolver for postcss-import. This provides the ability to use webpack aliases in css as described in postcss-import#190.

Install

Using npm, do:

npm install postcss-import-webpack-resolver --dev

Example

const cssImport = require('postcss-import');
const createResolver = require('postcss-import-webpack-resolver');
 
const postcssPlugins = [
  cssImport({
    resolve: createResolver({
      // use aliases defined in config
      alias: webpackConfig.resolve.alias,
 
      // include where to look for modules
      modules: ['src', 'node_modules']
    })
  })
]

createResolver(opts)

returns a postcss-import resolve function, takes the same options as enhanced-resolve. Please refer there for proper API documentation.

License

MIT 2017

install

npm i postcss-import-webpack-resolver

Downloadsweekly downloads

621

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability