add includePaths
This commit is contained in:
12
ts/index.ts
12
ts/index.ts
@ -4,13 +4,20 @@ import * as plugins from './smartsass.plugins'
|
||||
import { Result } from 'node-sass'
|
||||
|
||||
export interface ISmartsassConstructorOptions {
|
||||
entryFilePath: string
|
||||
entryFilePath: string,
|
||||
includePaths?: string[]
|
||||
}
|
||||
|
||||
export class Smartsass {
|
||||
includePaths = []
|
||||
entryFilePath: string
|
||||
constructor(optionsArg: ISmartsassConstructorOptions) {
|
||||
this.entryFilePath = optionsArg.entryFilePath
|
||||
if(optionsArg.includePaths) {
|
||||
for (let includePath of optionsArg.includePaths) {
|
||||
this.includePaths.push(includePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -19,7 +26,8 @@ export class Smartsass {
|
||||
render() {
|
||||
let done = plugins.smartq.defer<plugins.sass.Result>()
|
||||
plugins.sass.render({
|
||||
file: this.entryFilePath
|
||||
file: this.entryFilePath,
|
||||
includePaths: this.includePaths
|
||||
}, function (err, result) {
|
||||
if (err) {
|
||||
console.log(err)
|
||||
|
Reference in New Issue
Block a user