Moved Content Provider Dashboard to new generator
diff --git a/views/ngXosViews/contentProvider/gulp/server.js b/views/ngXosViews/contentProvider/gulp/server.js
index f16d6f2..78c1620 100644
--- a/views/ngXosViews/contentProvider/gulp/server.js
+++ b/views/ngXosViews/contentProvider/gulp/server.js
@@ -9,6 +9,7 @@
var wiredep = require('wiredep').stream;
var httpProxy = require('http-proxy');
var del = require('del');
+var sass = require('gulp-sass');
const environment = process.env.NODE_ENV;
@@ -34,12 +35,8 @@
module.exports = function(options){
- // open in browser with sync and proxy to 0.0.0.0
gulp.task('browser', function() {
browserSync.init({
- // reloadDelay: 500,
- // logLevel: 'debug',
- // logConnections: true,
startPath: '#/',
snippetOptions: {
rule: {
@@ -49,14 +46,16 @@
server: {
baseDir: options.src,
routes: {
- '/api': options.api,
- '/xosHelpers/src': options.helpers
+ '/xos/core/xoslib/static/js/vendor': options.helpers,
+ '/xos/core/static': options.static + '../../static/'
},
middleware: function(req, res, next){
if(
- req.url.indexOf('/xos/') !== -1 ||
- req.url.indexOf('/xoslib/') !== -1 ||
- req.url.indexOf('/hpcapi/') !== -1
+ // to be removed, deprecated API
+ // req.url.indexOf('/xos/') !== -1 ||
+ // req.url.indexOf('/xoslib/') !== -1 ||
+ req.url.indexOf('/hpcapi/') !== -1 ||
+ req.url.indexOf('/api/') !== -1
){
if(conf.xoscsrftoken && conf.xossessionid){
req.headers.cookie = `xoscsrftoken=${conf.xoscsrftoken}; xossessionid=${conf.xossessionid}`;
@@ -78,6 +77,26 @@
gulp.watch(options.src + '**/*.html', function(){
browserSync.reload();
});
+ gulp.watch(options.css + '**/*.css', function(){
+ browserSync.reload();
+ });
+ gulp.watch(`${options.sass}/**/*.scss`, ['sass'], function(){
+ browserSync.reload();
+ });
+
+ gulp.watch([
+ options.helpers + 'ngXosHelpers.js',
+ options.static + '../../static/xosNgLib.css'
+ ], function(){
+ browserSync.reload();
+ });
+ });
+
+ // compile sass
+ gulp.task('sass', function () {
+ return gulp.src(`${options.sass}/**/*.scss`)
+ .pipe(sass().on('error', sass.logError))
+ .pipe(gulp.dest(options.css));
});
// transpile js with sourceMaps
@@ -94,8 +113,7 @@
inject(
gulp.src([
options.tmp + '**/*.js',
- options.api + '*.js',
- options.helpers + '**/*.js'
+ options.helpers + 'ngXosHelpers.js'
])
.pipe(angularFilesort()),
{
@@ -111,7 +129,10 @@
return gulp.src(options.src + 'index.html')
.pipe(
inject(
- gulp.src(options.src + 'css/*.css'),
+ gulp.src([
+ options.src + 'css/*.css',
+ options.static + '../../static/xosNgLib.css'
+ ]),
{
ignorePath: [options.src]
}
@@ -137,10 +158,11 @@
gulp.task('serve', function() {
runSequence(
+ 'sass',
'bower',
'injectScript',
'injectCss',
['browser']
);
});
-};
\ No newline at end of file
+};