How to generate map files for CSS in a sails app?

痴心易碎 提交于 2020-01-05 03:26:32

问题


Hi have a sails project with bootstrap included in bower.json:

...
  "dependencies": {
...
    "bootstrap": "~3.2.0"
...
  }

All the css, fonts and js are copied correctly but the map file is not copied to the assets/vendor/bootstrap directory nor the .tmp dir.

I can't figure out what process copies the filed from bower_components/bootstrap/dist/css where the bootstrap.css.map file does exists.

There must be something from tasks/config/bower.js but I am a bit puzzled on how bower know which files to copy. Especially since the default layout: 'byType' does not match the assets/vendor at all so there must be something else I am missing.

Thanks


回答1:


I fixed the issue by adding the following to bower.json:

...
"exportsOverride": {
  "bootstrap": {
      "css": ["dist/css/bootstrap.css",
               "dist/css/bootstrap.css.map"],
      "js": "dist/js/bootstrap.js",
      "fonts": "dist/fonts"
  }
}
...

This is also a fix to copy fonts. See http://blog.mdarveau.com/2014/10/10/using-fontawesome-and-glyphicons-in-a-sails-app



来源:https://stackoverflow.com/questions/26477828/how-to-generate-map-files-for-css-in-a-sails-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!