MOBILE-2163 core: Copy component templates to www
parent
1834cb623c
commit
f3d103f311
38
gulpfile.js
38
gulpfile.js
|
@ -6,6 +6,8 @@ var gulp = require('gulp'),
|
||||||
slash = require('gulp-slash'),
|
slash = require('gulp-slash'),
|
||||||
clipEmptyFiles = require('gulp-clip-empty-files'),
|
clipEmptyFiles = require('gulp-clip-empty-files'),
|
||||||
gutil = require('gulp-util'),
|
gutil = require('gulp-util'),
|
||||||
|
flatten = require('gulp-flatten'),
|
||||||
|
npmPath = require('path'),
|
||||||
File = gutil.File,
|
File = gutil.File,
|
||||||
license = '' +
|
license = '' +
|
||||||
'// (C) Copyright 2015 Martin Dougiamas\n' +
|
'// (C) Copyright 2015 Martin Dougiamas\n' +
|
||||||
|
@ -185,6 +187,22 @@ function buildLangs(filenames, langPaths, buildDest, done) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete a folder and all its contents.
|
||||||
|
function deleteFolderRecursive(path) {
|
||||||
|
if (fs.existsSync(path)) {
|
||||||
|
fs.readdirSync(path).forEach(function(file) {
|
||||||
|
var curPath = npmPath.join(path, file);
|
||||||
|
if (fs.lstatSync(curPath).isDirectory()) {
|
||||||
|
deleteFolderRecursive(curPath);
|
||||||
|
} else {
|
||||||
|
fs.unlinkSync(curPath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
fs.rmdirSync(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// List of app lang files. To be used only if cannot get it from filesystem.
|
// List of app lang files. To be used only if cannot get it from filesystem.
|
||||||
var appLangFiles = ['ar.json', 'bg.json', 'ca.json', 'cs.json', 'da.json', 'de.json', 'en.json', 'es-mx.json', 'es.json', 'eu.json',
|
var appLangFiles = ['ar.json', 'bg.json', 'ca.json', 'cs.json', 'da.json', 'de.json', 'en.json', 'es-mx.json', 'es.json', 'eu.json',
|
||||||
'fa.json', 'fr.json', 'he.json', 'hu.json', 'it.json', 'ja.json', 'nl.json', 'pl.json', 'pt-br.json', 'pt.json', 'ro.json',
|
'fa.json', 'fr.json', 'he.json', 'hu.json', 'it.json', 'ja.json', 'nl.json', 'pl.json', 'pt-br.json', 'pt.json', 'ro.json',
|
||||||
|
@ -269,3 +287,23 @@ gulp.task('config', function(done) {
|
||||||
.pipe(gulp.dest(paths.src))
|
.pipe(gulp.dest(paths.src))
|
||||||
.on('end', done);
|
.on('end', done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var templatesSrc = [
|
||||||
|
'./src/components/**/*.html',
|
||||||
|
'./src/core/**/components/**/*.html',
|
||||||
|
'./src/core/**/component/**/*.html',
|
||||||
|
'./src/addon/**/components/**/*.html',
|
||||||
|
'./src/addon/**/component/**/*.html'
|
||||||
|
],
|
||||||
|
templatesDest = './www/templates';
|
||||||
|
|
||||||
|
// Copy component templates to www to make compile-html work in AOT.
|
||||||
|
gulp.task('copy-component-templates', function(done) {
|
||||||
|
deleteFolderRecursive(templatesDest);
|
||||||
|
|
||||||
|
gulp.src(templatesSrc)
|
||||||
|
.pipe(flatten())
|
||||||
|
.pipe(gulp.dest(templatesDest))
|
||||||
|
.on('end', done);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
"ionic:build": "node --max-old-space-size=16384 ./node_modules/@ionic/app-scripts/bin/ionic-app-scripts.js build",
|
"ionic:build": "node --max-old-space-size=16384 ./node_modules/@ionic/app-scripts/bin/ionic-app-scripts.js build",
|
||||||
"ionic:serve": "gulp watch | ionic-app-scripts serve",
|
"ionic:serve": "gulp watch | ionic-app-scripts serve",
|
||||||
"ionic:build:before": "gulp",
|
"ionic:build:before": "gulp",
|
||||||
"ionic:watch:before": "gulp"
|
"ionic:watch:before": "gulp",
|
||||||
|
"ionic:build:after": "gulp copy-component-templates",
|
||||||
|
"postionic:build": "gulp copy-component-templates"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "5.2.10",
|
"@angular/animations": "5.2.10",
|
||||||
|
@ -86,6 +88,7 @@
|
||||||
"@ionic/app-scripts": "3.1.9",
|
"@ionic/app-scripts": "3.1.9",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-clip-empty-files": "^0.1.2",
|
"gulp-clip-empty-files": "^0.1.2",
|
||||||
|
"gulp-flatten": "^0.4.0",
|
||||||
"gulp-rename": "^1.2.2",
|
"gulp-rename": "^1.2.2",
|
||||||
"gulp-slash": "^1.1.3",
|
"gulp-slash": "^1.1.3",
|
||||||
"through": "^2.3.8",
|
"through": "^2.3.8",
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { CoreUtilsProvider } from '@providers/utils/utils';
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'core-ion-tabs',
|
selector: 'core-ion-tabs',
|
||||||
templateUrl: 'ion-tabs.html',
|
templateUrl: 'core-ion-tabs.html',
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
providers: [{provide: RootNode, useExisting: forwardRef(() => CoreIonTabsComponent) }]
|
providers: [{provide: RootNode, useExisting: forwardRef(() => CoreIonTabsComponent) }]
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue