Node+Nginx project, the page uses http://cdn/project1/a.css, pro... such an address refers to css,
Each css may have a background with a relative path, such as background :url(./images/logo.png), after merging, the image path will report an error. Is there any way to solve it?
我想大声告诉你2017-05-16 17:10:14
Use absolute paths if possible
If you cannot use absolute paths and cannot mix css from different directories, you can call them separately
http://cdn/??a.css
http://cdn/project/??1.css,2.css
Build the same environment locally for testing, apache also has the concat component
曾经蜡笔没有小新2017-05-16 17:10:14
The relative path of the css file must be obtained based on the current css file. Just hang the corresponding pictures in the relative position on the cdn.