Skip to content
Custom resolve function for using postcss-import with webpack
Branch: master
Clone or download
Latest commit cdc155a Jul 30, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
index.js
package-lock.json
package.json

README.md

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

You can’t perform that action at this time.