node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

rtlcss-loader

rtlcss loader for webpack

Work just like css-loader and use rtlcss to RTLify your css.

installation

npm install rtlcss-loader --savde-dev

Usage

Documentation: Using loaders

module.exports = {
  module: {
    loaders: [
      {
        test: /\.css$/,
        loaders: ['style', 'rtlcss']
      }
    ]
  }
};

for SASS/LESS you'll need sass-loader first :

module.exports = {
  module: {
    loaders: [
      {
        test: /\.scss$/,
        loaders: ['style', 'rtlcss', 'sass']
      }
    ]
  }
};

IMPORTANT

if you want to use rtlcss directives such as /*rtl:ignore*/ make sure you are using it as a SPECIAL comment by adding ! before your comment, for example :

div {
  /*rtl:ignore*/
  margin: -25px -25px 0 0;
}

must be :

div {
  /*!rtl:ignore*/
  margin: -25px -25px 0 0;
}

License

MIT (http://www.opensource.org/licenses/mit-license.php)