WebOptimizer icon indicating copy to clipboard operation
WebOptimizer copied to clipboard

Incorrect path conversion when page has base tag

Open Nness opened this issue 1 year ago • 0 comments

Our MVC's _Layout.cshtml has <base href="/app/"> base tag, which cause all relative link became unusable in debug mode.

  • ~/bundle.scss or /bundle.scss will translate to {folder}/file.scss, where the browser will query on app/{folder}/file.scss
  • ~/bundle.js will translate to list of static javascript path, e.g. {folder}/file.js, the browser will also append base path to be query on app/{folder}/file.js

The only way to get around at moment is to add inline inside link or script tag. Even then, any file referenced in the scss file is still broken.

Nness avatar Aug 04 '24 23:08 Nness