mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00

* chore(demos): WIP refactor gulp demos task to use SystemJS move build files into dist/demos and comment out the AoT demos task for right now. This makes both `gulp demos` and `gulp demos.watch`work again. references #8411 * docs(demos): fix infinite scroll demo * chore(demos): move old demos task to demos.prod update the demos file with shared tasks, include the shared css * docs(demos): fix API demos to use correct styles * chore(demos): remove the main.ts files from each demo * chore(demos): add prod template and constant * chore(demos): remove tsconfig and package from demos * chore(demos): update app.module path to ionic * chore(demos): update app.module path to ionic * chore(demos): update prod task for demos to work with AoT also puts the demo build files into dist/ instead of the src directory * docs(demos): update deploy and docs tasks for new build * docs(scripts): update demos README * chore(demos): fix path for prod build
55 lines
1.3 KiB
TypeScript
55 lines
1.3 KiB
TypeScript
import { dest, src, task } from 'gulp';
|
|
import * as connect from 'gulp-connect';
|
|
import * as del from 'del';
|
|
import * as runSequence from 'run-sequence';
|
|
|
|
import { DEMOS_NAME, DIST_DEMOS_ROOT, LOCAL_SERVER_PORT, SCRIPTS_ROOT } from '../constants';
|
|
import { compileSass, copyFonts, createTimestamp, setSassIonicVersion, writePolyfills } from '../util';
|
|
|
|
task('demos.clean', (done: Function) => {
|
|
del([`${DIST_DEMOS_ROOT}/**`]).then(() => {
|
|
done();
|
|
}).catch(err => {
|
|
done(err);
|
|
});
|
|
});
|
|
|
|
task('demos.polyfill', (done: Function) => {
|
|
writePolyfills(`${DIST_DEMOS_ROOT}/polyfills`).then(() => {
|
|
done();
|
|
}).catch(err => {
|
|
done(err);
|
|
});
|
|
});
|
|
|
|
task('demos.copyAndCompile', (done: (err: any) => void) => {
|
|
runSequence(
|
|
'demos.copySource',
|
|
'demos.compileTests',
|
|
'demos.bundle',
|
|
done);
|
|
});
|
|
|
|
task('demos.copyExternalDependencies', () => {
|
|
src([`${SCRIPTS_ROOT}/${DEMOS_NAME}/*.css`]).pipe(dest(`${DIST_DEMOS_ROOT}/css`));
|
|
});
|
|
|
|
task('demos.sass', () => {
|
|
// ensure there is a version.scss file
|
|
setSassIonicVersion(`E2E-${createTimestamp()}`);
|
|
return compileSass(`${DIST_DEMOS_ROOT}/css`);
|
|
});
|
|
|
|
task('demos.fonts', () => {
|
|
return copyFonts(`${DIST_DEMOS_ROOT}/fonts`);
|
|
});
|
|
|
|
task('demos.serve', function() {
|
|
connect.server({
|
|
root: './',
|
|
port: LOCAL_SERVER_PORT,
|
|
livereload: {
|
|
port: 35700
|
|
}
|
|
});
|
|
}); |