Skip to content

Releases: css-modules/css-modules-require-hook

Additional options

08 Jan 21:15
Compare
Choose a tag to compare
  • Added the resolve option to provide possibility to adjust the way the ICSS imports are resolved. The resolve algorithm became stricter (closer to nodejs), but it doesn't affect the require paths. You may now omit the extension and provide custom module paths to for composes and @value paths.
  • Fixed double-dashes for camelCase option: #108
  • Updated deps in demo

Internals update

10 Sep 17:39
Compare
Choose a tag to compare
  • postcss-modules-parser was replaced with postcss-modules-resolve-imports.
  • fixes issue with nodejs 4 support.

Extended the camelCase option

20 Mar 08:25
Compare
Choose a tag to compare

For now, it accepts the similar to css-loader options: true|'dashes'|'dashesOnly'|'only'.
https://github.com/webpack-contrib/css-loader#camelcase

Totally removed demo folder from the published module

03 Oct 05:27
Compare
Choose a tag to compare

Removed test folder from the published module

03 Oct 05:22
Compare
Choose a tag to compare
4.0.4

added test folder to the .npmignore

Possibility to pass hashPrefix option

Added support for the scoped modules

18 Aug 14:09
Compare
Choose a tag to compare

Added camelCase option

29 May 09:47
Compare
Choose a tag to compare
4.0.1

version and publish scripts update

The API update

07 Mar 09:08
Compare
Choose a tag to compare

Since I removed the to option, so I decided to make a major release.

Anyways, now you can provide all the processor options to the postcss instance via processorOpts. For example:

const hook = require('css-modules-require-hook');
const lessParser = require('postcss-less').parse;

hook({
  extensions: '.less',
  processorOpts: {parser: lessParser},
});

Also, if you need to provide the to options, you may use processorOpts for that:

hook({
  processorOpts: {to: '..'},
});

The new API

24 Feb 21:50
Compare
Choose a tag to compare

Features:

— Added ignore option, so you can ignore particular files from processing. Supports globs, regexp and functions.
— Hook is not attached automatically now, so you need to make a function call first to make it work.
— Added possibility to use particular files as presets. In that case hook will be attached automatically and all options should be described in the cmrh.conf.js file. To use it, you should run: require('css-modules-require-hook/preset'). I hope it will solve the babel issue.
— Some internal updates.