Releases: css-modules/css-modules-require-hook
Additional options
- 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 therequire
paths. You may now omit the extension and provide custom module paths to forcomposes
and@value
paths. - Fixed double-dashes for
camelCase
option: #108 - Updated deps in demo
Internals update
postcss-modules-parser
was replaced withpostcss-modules-resolve-imports
.- fixes issue with nodejs 4 support.
Extended the camelCase option
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
4.0.5 totaly removed demo folder
Removed test folder from the published module
4.0.4 added test folder to the .npmignore
Possibility to pass hashPrefix option
Added support for the scoped modules
Added camelCase option
4.0.1 version and publish scripts update
The API update
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
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.