1 | const path = require('path');
|
2 | const hook = require('css-modules-require-hook');
|
3 | const stylus = require('stylus');
|
4 |
|
5 | module.exports = (sections, meta, callback) => {
|
6 |
|
7 |
|
8 | hook({
|
9 | generateScopedName: meta.cssScopedName,
|
10 | extensions: ['.styl'],
|
11 | preprocessCss: function (css, filename) {
|
12 | return stylus(css)
|
13 | .set('filename', filename)
|
14 | .render();
|
15 | }
|
16 | });
|
17 |
|
18 | var styles = require(path.join(meta.theme, 'css/index.styl'));
|
19 |
|
20 |
|
21 | styles['isolate-scope-root'] = meta.isolateScopeCssWrapperClass;
|
22 | styles['isolate-scope'] = meta.isolateScopeCssClass;
|
23 |
|
24 |
|
25 | meta.cssMap = styles;
|
26 | callback(null, sections);
|
27 | } |
\ | No newline at end of file |