-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace src after injection #160
Comments
+1 Found a kind of workaround for Django static (I guess that it's your problem)
wiredep: {
task: {
// Point to the files that should be updated when
// you run `grunt wiredep`
src: [
'src/static/javascripts.html', // .html support...
'src/static/stylesheets.html', // .html support...
],
options: {
// See wiredep's configuration documentation for the options
// you may pass:
// https://github.com/taptapship/wiredep#configuration
fileTypes: {
html: {
block: /(([ \t]*)<!--\s*bower:*(\S*)\s*-->)(\n|\r|.)*?(<!--\s*endbower\s*-->)/gi,
detect: {
js: /<script.*src=['"]([^']+)/gi,
css: /<link.*href=['"]([^']+)/gi
},
replace: {
js: '<script src="{% static \'{{filePath}}\' %}"></script>',
css: '<link rel="stylesheet" href="{% static \'{{filePath.path}}\' %}" />'
}
}
}
}
}
}
``
from inside javascripts.html and stylesheets.html, bower components are at the same level, so static url is well parsed.
Hope It helps you. |
You can use add the ignorePath parameter to ignore any relative path generated from your 'static' basepath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to replace :
<script src="../../../bower_components/angular/angular.js"></script>
by :
<script src="{% static 'angular/angular.js'}"></script>
The text was updated successfully, but these errors were encountered: