Skip to content
Snippets Groups Projects
Commit e8f768b9 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

Fix gulp build:web

parent b29d9600
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
"market": {
"APP_CONFIG": {
"DUNITER_NODE": "cgeek.fr:9330",
"DUNITER_NODE_ES": "test-net.duniter.fr:9202",
"DUNITER_NODE_ES": "test-net.duniter.fr:9203",
"NEW_ISSUE_LINK": "https://github.com/duniter/cesium/issues/new?labels=bug",
"TIMEOUT": 4000,
"DEBUG": false
......
......@@ -310,38 +310,41 @@ gulp.task('ng_annotate-plugin:web', ['templatecache-plugin:web'], function (done
gulp.task('optimize-files:web', ['ng_annotate:web', 'ng_annotate-plugin:web'], function(done) {
var tmpPath = './platforms/web/www';
var jsFilter = filter(["**/*.js", "!**/vendor/*"], { restore: true });
var jsFilter = filter(["**/*.js", "!**/vendor/*", '!**/config.js'], { restore: true });
var cssFilter = filter("**/*.css", { restore: true });
var indexHtmlFilter = filter(['**/*', '!**/index.html'], { restore: true });
var revFilesFilter = filter(['**/*', '!**/index.html', '!**/config.js'], { restore: true });
gulp.src(tmpPath + '/index.html')
.pipe(useref()) // Concatenate with gulp-useref
.pipe(useref()) // Concatenate with gulp-useref
// Process JS
.pipe(jsFilter)
.pipe(uglify()) // Minify any javascript sources
.pipe(jsFilter.restore)
// Process CSS
.pipe(cssFilter)
.pipe(csso()) // Minify any CSS sources
.pipe(cssFilter.restore)
.pipe(indexHtmlFilter)
.pipe(rev()) // Rename the concatenated files (but not index.html)
.pipe(indexHtmlFilter.restore)
.pipe(revReplace()) // Substitute in new filenames
// Add revision to filename (but not index.html and config.js)
.pipe(revFilesFilter)
.pipe(rev()) // Rename the concatenated files
.pipe(revFilesFilter.restore)
// Substitute in new filenames
.pipe(revReplace())
.pipe(gulp.dest(tmpPath))
.on('end', done);
});
gulp.task('clean-unused-files:web', ['optimize-files:web'], function(done) {
var tmpPath = './platforms/web/www';
var jsFilter = filter(["**/*.js", "!**/cesium-*.js"]);
var cssFilter = filter(["**/*.css", "!**/cesium-*.css"]);
es.concat(
gulp.src(tmpPath + '/js/**/*.js', {read: false})
.pipe(jsFilter)
.pipe(clean()),
gulp.src(tmpPath + '/css/**/*.css', {read: false})
.pipe(cssFilter)
.pipe(clean())
)
.on ('end', done);
......@@ -356,7 +359,8 @@ gulp.task('clean-unused-directories:web', ['clean-unused-files:web'], function(d
tmpPath + '/dist',
tmpPath + '/lib/ionic/scss',
tmpPath + '/lib/ionic/css',
tmpPath + '/lib/ionic/js'
tmpPath + '/lib/ionic/js',
tmpPath + '/lib/ionic/version.json'
]);
});
......
......@@ -4,12 +4,10 @@
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Cesium</title>
<link rel="icon" href="./img/favicon.ico">
<link rel="manifest" href="/manifest.json">
<link rel="icon" href="./img/favicon.ico">
<link rel="manifest" href="/manifest.json">
<!-- build:css dist_css/cesium.css -->
<link href="css/ionic.app.css" rel="stylesheet">
<link href="css/ionic.app.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!--removeIf(device)-->
......@@ -20,8 +18,7 @@
<link href="dist/dist_css/plugins/es/css/style.css" rel="stylesheet">
<!--endRemoveIf(device)-->
<!-- endbuild -->
<!-- build:js dist_js/cesium.js -->
<!-- build:js dist_js/vendor.js -->
<!-- vendor js -->
<script src="js/vendor/moment.min.js"></script>
<script src="js/vendor/moment.fr.js"></script>
......@@ -51,10 +48,8 @@
<script src="js/vendor/ng-cordova.min.js"></script>
<script src="cordova.js"></script>
<!--endRemoveIf(no-device)-->
<!-- config -->
<script src="js/config.js"></script>
<!-- endbuild -->
<!-- build:js dist_js/cesium.js -->
<!-- services -->
<script src="dist/dist_js/app/services/crypto-services.js"></script>
<script src="dist/dist_js/app/services/utils-services.js"></script>
......@@ -116,9 +111,12 @@
<script src="dist/dist_js/app/directives.js"></script>
<script src="dist/dist_js/app/app.js"></script>
<!-- endbuild -->
<!-- build:js config.js -->
<!-- config -->
<script src="js/config.js"></script>
<!-- endbuild -->
</head>
<body ng-app="cesium" ng-strict-di>
<ion-nav-view></ion-nav-view>
<ion-nav-view></ion-nav-view>
</body>
</html>
......@@ -10,12 +10,11 @@ angular.module("cesium.config", [])
.constant("APP_CONFIG", {
"DUNITER_NODE": "cgeek.fr:9330",
"DUNITER_NODE_ES": "test-net.duniter.fr:9202",
"NEW_ISSUE_LINK": "https://github.com/duniter/cesium/issues/new?labels=bug",
"TIMEOUT": 4000,
"DEBUG": false,
"VERSION": "0.1.27",
"BUILD_DATE": "2016-08-18T12:55:59.884Z"
"BUILD_DATE": "2016-08-18T14:27:04.933Z"
})
;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment