medialize / sass.js

Sass.js - API for emscripted libsass to run in the browser

Home Page:http://medialize.github.io/playground.sass.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to set compile source base direction?

zfha opened this issue · comments

My files structure is :

| -- index.html
     | -- style
           | -- nav.scss
           | -- index.scss

First, I use writeFile add nav.scss.

sass.writeFile('style/nav.scss', 'xxx');

Then, I compile index.scss source content.

sass.compile('@import './nav.scss', function(){})

but I get this error:

Error: File to import not found or unreadable: ./nav.scss.
        on line 13:1 of /style
>> @import './nav.scss';

how to set the compile source base directory

how to set the compile source base directory

you can't. the working directory is fixed to "root". I'd suggest to also writeFile()´ your style/index.scssand the usesass.compileFIle('style/index.scss')`.