Open Giovanni-Mattucci opened 8 years ago
No, for me it works with
Two of my collegues have the same problem. For me it works.
No errors.cshtml
-files. Correct path?
Hi,
I've had the same problems here but now I've found a working version. The trick is to remove the starting~
from every href
and src
attribute in your cshtml files.
Does not work:
<link rel="stylesheet" href="~/styles/bootstrap.css">
Works:
<link rel="stylesheet" href="/styles/bootstrap.css">
My Gruntfile is:
// Usemin bundler
"useminPrepare": {
options: {
dest: "<%= config.release.wwwroot %>",
root: "<%= config.debug.wwwroot %>"
},
html: "<%= config.debug.root %>/Views/Shared/_Layout.cshtml",
css: "<%= config.debug.styles %>/*.css"
},
// Performs rewrites based on rev and the useminPrepare configuration
"usemin": {
options: {
assetsDirs: ["<%= config.release.wwwroot %>"]
},
html: ["<%= config.release.root %>/Views/*/*.cshtml"],
css: ["<%= config.release.styles %>/*.css"]
},
// Add version tag to filenames
"filerev": {
dist: {
src: [
"<%= config.release.styles %>/*.css",
"<%= config.release.scripts %>/*.js",
"<%= config.release.images %>/**/*"
]
}
},
The problem is that this will brake all the Area views because the links wont work anymore...
Gruntfile use to relative path; but I hope to support “〜/” and “/”.
+1
+1
+99
I'm having trouble with usemin not updating URLs within my
.cshtml
files. Here is my current setup in mygruntfile.js
:Does usemin only work with .html files? Or will it scan any file and replace those URL strings?
As an FYI I utilized this yeoman generator to create this file initially.