-
Notifications
You must be signed in to change notification settings - Fork 0
/
stylusLoader.js
33 lines (25 loc) · 860 Bytes
/
stylusLoader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var nib = require('nib');
var jeet = require('jeet');
module.exports = function sassPlugin (context, operations) {
operations.commands.modify('build')
.before((context, args) => {
var ExtractTextPlugin = operations.dependencies.resolve('extract-text-webpack-plugin');
context.webpackConfig.module.loaders.push({
test: /\.styl/,
loader: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader!stylus' })
});
context.webpackConfig.stylus = {
use: [jeet(), nib()]
};
});
operations.commands.modify('start')
.before((context, args) => {
context.webpackConfig.module.loaders.push({
test: /\.styl/,
loaders: ['style', 'css?sourceMap', 'stylus']
});
context.webpackConfig.stylus = {
use: [jeet(), nib()]
};
});
};