madskristensen / BundlerMinifier

Visual Studio extension
Other
616 stars 173 forks source link

url path in css was changed #215

Open mbielecki opened 7 years ago

mbielecki commented 7 years ago

Hello, in my bundleconfig.json i have

 {
    "outputFileName": "wwwroot/static/css/bootstrap.css",
    "inputFiles": [
      "www_components/css/bootstrap.css"
    ],
    "minify": {
      "enabled": false
    }
  }

In bootstrap.css (inputFile) i have path to font

  src: url('../fonts/glyphicons-halflings-regular.eot');

The output file (bootstrap.css) is changed on a path

src: url('../../../www_components/fonts/glyphicons-halflings-regular.eot');

Why path is changed? Thanks for help.

yzdel200 commented 7 years ago
"minify": {
  "adjustRelativePaths": false
}
DMW007 commented 7 years ago

Seems like this is very buggy in Docker containers. Per default, I got absolutely broken paths there like this:

@font-face {
    font-family: 'Calibri';
    src: url('/app/src/MyProject/wwwroot/clientscript/site.min.css') format('eot');
}

site.min.css is the name of the bundled output file.

Originally, the css source code was this:

@font-face {
    font-family: 'Calibri';
    src: url('../fonts/Calibri.eot?') format('eot');
}

adjustRelativePaths would leave them unchanged, but is not a real solution for me since the relative paths are not valid too cause the generated combined and minified file is in a different location.

I opened #217 since I'm not sure if the problem mentioned here could be solved using adjustRelativePaths. My can't cause the rewriting of the paths is required, but its done wrong on Linux.

ghost commented 7 years ago

I have a bit different problem. CSS paths are rewritten without consideration of wwwroot...

Bundle points to fonts located in project root not wwwroot... So of course such path are not available.

For example this path is wrong: src: url('../../frameworks/bootstrap/dist/fonts/glyphicons-halflings-regular.eot');

How to specify some base path? To get fonts from correct place...