如何在风帆应用程序中为 CSS 生成地图文件? [英] How to generate map files for CSS in a sails app?
问题描述
有一个包含在 bower.json 中的 bootstrap 的风帆项目:
<代码>...依赖关系":{...引导程序":~3.2.0"...}
所有的 css、字体和 js 都被正确复制,但地图文件没有复制到 assets/vendor/bootstrap
目录和 .tmp
目录.>
我无法弄清楚是什么进程从 bower_components/bootstrap/dist/css
复制了该文件,其中 bootstrap.css.map
文件确实存在.
一定有来自 tasks/config/bower.js
的东西,但我对 bower 如何知道要复制哪些文件感到有些困惑.尤其是因为默认的 layout: 'byType'
根本不匹配 assets/vendor
所以肯定还有我遗漏的东西.
谢谢
我通过将以下内容添加到 bower.json 解决了该问题:
<代码>...出口覆盖":{引导程序":{"css": ["dist/css/bootstrap.css","dist/css/bootstrap.css.map"],"js": "dist/js/bootstrap.js",字体":分布/字体"}}...
这也是复制字体的修复.请参阅 http://blog.mdarveau.com/2014/10/10/using-fontawesome-and-glyphicons-in-a-sails-app
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
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
这篇关于如何在风帆应用程序中为 CSS 生成地图文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!