Skip to content

Commit

Permalink
pass options to less and stylus loaders
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Feb 22, 2018
1 parent bf33792 commit 71a2265
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/less-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export default {
const less = localRequire('less')

let { css, map } = await pify(less.render.bind(less))(code, {
...this.options,
sourceMap: this.sourceMap && {},
filename: this.id,
relativeUrls: true
filename: this.id
})

if (map) {
Expand Down
9 changes: 6 additions & 3 deletions src/stylus-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ export default {
async process({ code }) {
const stylus = localRequire('stylus')

const style = stylus(code)
.set('filename', this.id)
.set('sourcemap', this.sourceMap && {})
const style = stylus(code, {
...this.options,
filename: this.id,
sourcemap: this.sourceMap && {}
})

const css = await pify(style.render.bind(style))()

return {
code: css,
map: style.sourcemap
Expand Down

0 comments on commit 71a2265

Please sign in to comment.