Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开启 watch + md5 时会出现 map.json 中找不到对应的 sass #1

Closed
nimoc opened this issue Aug 31, 2015 · 3 comments
Closed

Comments

@nimoc
Copy link

nimoc commented Aug 31, 2015

fex-team/fis-parser-sass#30 (comment)

@nimojs fis-parser-sass 之所以基于 fis-sass 是因为当时编译机上安装不上,所以自己包装了下 lib-sass 库,我觉得 fis-parser-sass2 我觉得只要处理好两个事情应该就能用了:

保存缓存依赖。比如 b.scss @import 了 a.scss, 需要把 b 的 cache 对象里面标记依赖 a. 标记后, watch 的时候, a 文件变化,会触发 b 文件重新编译。
路径问题,比如 a.scss 文件里面引用了某个图片,但是是相对与 a.scss 文件,如果其他目录下面的 scss 文件 @import 了 a.scss, 路径应该没有修改过来。
关于以上两个功能,可以参考 fis-parser-sass

@lwdgit
Copy link
Owner

lwdgit commented Sep 1, 2015

谢谢你的反馈, 已经纠正了这些错误,请帮忙测试一下,最新版是[email protected]

lwdgit added a commit that referenced this issue Sep 1, 2015
@nimoc
Copy link
Author

nimoc commented Sep 1, 2015

var sass = require('./node-sass');

用相对路径是因为什么?


sudo npm install -g [email protected]
console.log(require('fis-parser-sass2'))
Error: Cannot find module './node-sass'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/nimojs/node_modules/fis-parser-sass2/index.js:11:12)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

修改

var sass = require('node-sass'); 

就可以运行了

@lwdgit
Copy link
Owner

lwdgit commented Sep 1, 2015

ok

@lwdgit lwdgit closed this as completed Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants