Comments (5)
Hi, I seem to have a similar problem with wiredep prepending relative paths to bower_components in the processed html file.
Below is the code I have in my gulpfile.js and gulp.config.js
(gulpfile.js)
gulp.task('wiredep', function () {
log('Wire up the bower css js and our app js into the html');
var options = config.getWiredepDefaultOptions();
var wiredep = require('wiredep').stream;
return gulp
.src(config.index)
.pipe($.debug(true))
.pipe(wiredep(options))
.pipe($.inject(gulp.src(config.js)))
.pipe(gulp.dest(config.client));
}
(gulp.config.js)
var config = {
/**
* File paths
/
// all js to vet
alljs: [
'./src/__/.js',
'./*.js'
],
build: './build/',
client: client,
server: server,
temp: temp,
css: temp + 'styles.css',
fonts: './bower_components/font-awesome/fonts/**/*.*',
htmltemplates: clientApp + '**/*.html',
images: client + 'images/**/*.*',
index: client + 'index.html',
js: [
clientApp + '**/*.module.js',
clientApp + '**/*.js',
'!' + clientApp + '**/*.spec.js',
],
less: client + 'styles/styles.less',
/*
* template cache
*/
templateCache: {
file: 'template.js',
options: {
module: 'app.core',
standAlone: false,
root: 'app/'
}
},
/*
* browser sync
*/
browserReloadDeplay: 1000,
/*
* Bower and NPM locations
*/
bower: {
json: require('./bower.json'),
directory: './bower_components/',
ignorePath: '../..'
},
/**
* Node settings
*/
defaultPort: 7203,
nodeServer: './src/server/app.js'
};
config.getWiredepDefaultOptions = function () {
var options = {
bowerJson: config.bower.json,
directory: config.bower.directory,
ignorePath: config.bower.ignorePath
};
};
Index.html (before running gulp task)
<!-- build:css styles/lib.css -->
<!-- bower:css -->
<link rel="stylesheet" href="/bower_components/font-awesome/css/font-awesome.css" />
<link rel="stylesheet" href="/bower_components/toastr/toastr.css" />
<!-- endbower -->
<!-- endbuild -->
index.html (after running gulp task)
<!-- build:css styles/lib.css -->
<!-- bower:css -->
<link rel="stylesheet" href="../../bower_components/font-awesome/css/font-awesome.css" />
<link rel="stylesheet" href="../../bower_components/toastr/toastr.css" />
<!-- endbower -->
<!-- endbuild -->
Any pointer would be highly appreciated!
from generator-gulp-angular.
Do you install Django with 'bower install' ?
from generator-gulp-angular.
django is a python package . there shouldn't be any need for it, i had been doing the same thing with grunt without using bower install package for django
from generator-gulp-angular.
okay, must include the gulp.dest, the final looks like this
gulp.src('../../templates/backoffice/__base.html')
.pipe(wiredep({
ignorePath: '../../static/',
fileTypes: {
html: {
replace: {
js: '<script src="{{ STATIC_URL }}{{filePath}}"></script>',
css: '<link rel="stylesheet" href="{{ STATIC_URL }}{{filePath}}" />'
}
}
}
}))
.pipe(gulp.dest('../../templates/backoffice'));
from generator-gulp-angular.
Right.
Without gulp.dest you don't have new file.
from generator-gulp-angular.
Related Issues (20)
- Troubles using the app inside electron
- 404 not found error for template after gulp build: serve
- How to install angular-google-maps to project
- What is the relation with URL and templateUrl ?
- Making a deployable app HOT 1
- Init angular with angular.boostrap
- $http post error 404
- running gulp minify-inline adds ="" in scriptlets
- Cannot find namespace 'angular'.
- typeerror: must be string Received undefined HOT 1
- How to inject my own css and js of bootstrap theme ?
- How can I change this behaviour to launch Chrome instead of IE with npm start? HOT 5
- I want to remove # from URL.
- Pull request failed: continuous-integration/travis-ci/pr — The Travis CI build failed HOT 1
- tween two tr
- created by error
- migrate from angular 1 to 5 HOT 1
- Directive doesnt work after build
- Error: ENOENT: no such file or directory, open 'target/tmp/templates.js'
- .
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-gulp-angular.