Skip to content

Commit 3486df7

Browse files
committed
More spa fixes for compiling correctly
1 parent d113a30 commit 3486df7

File tree

3 files changed

+37
-15
lines changed

3 files changed

+37
-15
lines changed

gulpfile.js

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Set up core routes
22
var modulesRoot = {
3-
src: 'assets/src/modules',
4-
dest: 'assets/prod/modules'
3+
src: 'assets/src/modules/',
4+
dest: 'assets/prod/modules/'
55
};
66

77
var assetModuleList = {
@@ -72,8 +72,11 @@ var dump = function(tvar) {
7272
// Import required plugins
7373
var gulp = require('gulp');
7474
var htmlmin = require('gulp-htmlmin');
75+
var ngmin = require('gulp-ngmin');
7576
var uglify = require('gulp-uglify');
76-
77+
var clean = require('gulp-clean');
78+
var concat = require('gulp-concat');
79+
var rename = require('gulp-rename');
7780

7881
// Define Tasks
7982
gulp.task('templates', function() {
@@ -85,26 +88,43 @@ gulp.task('templates', function() {
8588
caseSensitive: true,
8689
keepClosingSlash: true
8790
}))
91+
.pipe(rename({suffix: '.min'}))
8892
.pipe(gulp.dest(templatePaths.dest));
8993
});
9094
});
9195

9296
// Define Tasks
9397
gulp.task('js', function() {
9498
doFor('js', function(jsPaths) {
95-
gulp.src(templatePaths.src)
96-
.pipe(htmlmin({
97-
collapseWhitespace: true,
98-
caseSensitive: true,
99-
keepClosingSlash: true
100-
}))
99+
gulp.src(jsPaths.src)
100+
.pipe(ngmin())
101+
.pipe(uglify({outSourceMap: true}))
102+
//.pipe(rename({suffix: '.min'}))
103+
//.pipe(gulp.dest(jsPaths.dest))
104+
//.pipe(concat('dist.min.js'))
101105
.pipe(gulp.dest(jsPaths.dest));
102106
});
103107
});
104108

105109
gulp.task('watch', function() {
106-
gulp.watch(paths.templates.src, ['templates']);
110+
111+
doFor('templates', function(templatePaths) {
112+
gulp.watch(templatePaths, ['templates']);
113+
});
114+
115+
doFor('js', function(jsPaths) {
116+
gulp.watch(jsPaths, ['js']);
117+
});
118+
119+
});
120+
121+
gulp.task('clean', function() {
122+
return gulp.src(modulesRoot.dest, {read: false})
123+
.pipe(clean());
124+
});
125+
126+
gulp.task('build', /*['clean'],*/ function() {
127+
gulp.start('templates', 'js');
107128
});
108129

109-
gulp.task('build', ['templates']);
110130
gulp.task('default', ['build']);

index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848

4949
<!-- STYLE SHEETS -->
5050
<link rel="stylesheet" href="//brick.a.ssl.fastly.net/Roboto:300,700">
51-
<link rel="stylesheet" href="<?=$HTTPROOTADDRESS?>inc/bootstrap.css?v=<?=$APP_VERSION?>">
51+
<link rel="stylesheet" href="<?=$HTTPROOTADDRESS?>assets/prod/modules/sm/App/styles/bootstrap.css?v=<?=$APP_VERSION?>">
5252
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.css">
53-
<link rel="stylesheet" href="<?=$HTTPROOTADDRESS?>inc/global.css?v=<?=$APP_VERSION?>">
53+
<link rel="stylesheet" href="<?=$HTTPROOTADDRESS?>assets/prod/modules/sm/App/styles/global.css?v=<?=$APP_VERSION?>">
5454

5555
<!-- OPEN GRAPH TAGS -->
5656
<meta name="twitter:card" content="photo">
@@ -112,7 +112,7 @@
112112
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.15/angular-animate.min.js"></script>
113113
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.15/angular-sanitize.min.js"></script>
114114
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.8/angular-ui-router.min.js"></script>
115-
<script src="<?=$HTTPROOTADDRESS?>js/app.js?v=<?=$APP_VERSION?>"></script>
115+
<script src="<?=$HTTPROOTADDRESS?>assets/prod/modules/sm/dist.min.js?v=<?=$APP_VERSION?>"></script>
116116
<script>
117117
// GOOGLE ANALYTICS CODE
118118
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"gulp-concat": "^2.2.0",
4646
"gulp-uglify": "^0.2.1",
4747
"gulp-jshint": "^1.5.3",
48-
"gulp-less": "^1.2.3"
48+
"gulp-less": "^1.2.3",
49+
"gulp-clean": "^0.2.4",
50+
"gulp-ngmin": "^0.2.0"
4951
}
5052
}

0 commit comments

Comments
 (0)