Skip to content

mikesmit/craco-resolve-url-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Craco resolve-url-loader plugin

A plugin to fix the annoying way sass/scss doesn't support relative paths out of the box in your create-react-app v2 application. Without ejecting!

Installation

npm install --save craco-resolve-url-loader

update your craco.config.js as follows:

const resolveUrlLoader = require('craco-resolve-url-loader');

module.exports = {
  plugins:[{
    plugin:resolveUrlLoader
  }]
};

Now sass and scss files will resolve url's relative to the current file like so:

@font-face {
  font-family: 'myfont';
  src: url('../fonts/myfont.eot?v=0.1.0');
  font-weight: normal;
  font-style: normal;
}

License

Licensed under the MIT License, Copyright ©️ 2018 Michael Smit. See LICENSE.md for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published