mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
@ -1,4 +1,4 @@
|
|||||||
import {ActionSheetPage} from 'actionSheet/actionSheet';
|
import {ActionSheetPage} from './actionSheet/actionSheet';
|
||||||
|
|
||||||
import {ButtonsPage,
|
import {ButtonsPage,
|
||||||
BlockButtonsPage,
|
BlockButtonsPage,
|
||||||
@ -9,18 +9,18 @@ import {ButtonsPage,
|
|||||||
FabPage,
|
FabPage,
|
||||||
ButtonSizesPage,
|
ButtonSizesPage,
|
||||||
IconButtonsPage,
|
IconButtonsPage,
|
||||||
ButtonsInComponentsPage} from 'buttons/buttons';
|
ButtonsInComponentsPage} from './buttons/buttons';
|
||||||
|
|
||||||
import {CardsPage} from 'cards/cards';
|
import {CardsPage} from './cards/cards';
|
||||||
import {FormsPage} from 'forms/forms';
|
import {FormsPage} from './forms/forms';
|
||||||
import {IconsPage} from 'icons/icons';
|
import {IconsPage} from './icons/icons';
|
||||||
import {ListsPage} from 'lists/lists';
|
import {ListsPage} from './lists/lists';
|
||||||
import {MenusPage} from 'menus/menus';
|
import {MenusPage} from './menus/menus';
|
||||||
import {ModalsPage} from 'modals/modals';
|
import {ModalsPage} from './modals/modals';
|
||||||
import {NavigationPage} from 'navigation/navigation';
|
import {NavigationPage} from './navigation/navigation';
|
||||||
import {PopupsPage} from 'popups/popups';
|
import {PopupsPage} from './popups/popups';
|
||||||
import {SlidesPage} from 'slides/slides';
|
import {SlidesPage} from './slides/slides';
|
||||||
import {TabsPage} from 'tabs/tabs';
|
import {TabsPage} from './tabs/tabs';
|
||||||
|
|
||||||
|
|
||||||
export function toTitleCase(str) {
|
export function toTitleCase(str) {
|
||||||
@ -52,5 +52,3 @@ export function getPageFor(hash) {
|
|||||||
'tabs': TabsPage
|
'tabs': TabsPage
|
||||||
}[hash]
|
}[hash]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import {App, IonicApp, IonicPlatform, ActionSheet} from 'ionic/ionic';
|
import {App, IonicApp, IonicPlatform, ActionSheet} from 'ionic/ionic';
|
||||||
import {Page, IonicConfig, Events} from 'ionic/ionic';
|
import {Page, IonicConfig, Events} from 'ionic/ionic';
|
||||||
import {ActionSheetPage} from 'actionSheet/actionSheet';
|
import {ActionSheetPage} from './actionSheet/actionSheet';
|
||||||
import * as helpers from 'helpers';
|
import * as helpers from './helpers';
|
||||||
|
|
||||||
|
|
||||||
@App({
|
@App({
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {App, IonicApp, Page, NavController, NavParams} from 'ionic/ionic';
|
import {App, IonicApp, Page, NavController, NavParams} from 'ionic/ionic';
|
||||||
import {Page, Events} from 'ionic/ionic';
|
import {Page, Events} from 'ionic/ionic';
|
||||||
import * as helpers from 'helpers';
|
import * as helpers from './helpers';
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
templateUrl: 'menus/menu-home.html'
|
templateUrl: 'menus/menu-home.html'
|
||||||
@ -54,5 +54,3 @@ export class MenusPage {
|
|||||||
this.nav.setRoot(page.component);
|
this.nav.setRoot(page.component);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {App, IonicApp, Animation, Modal, NavController, Page, Events} from 'ionic/ionic';
|
import {App, IonicApp, Animation, Modal, NavController, Page, Events} from 'ionic/ionic';
|
||||||
import * as helpers from 'helpers';
|
import * as helpers from './helpers';
|
||||||
|
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {NavController, NavParams} from 'ionic/ionic';
|
import {NavController, NavParams} from 'ionic/ionic';
|
||||||
import {Page, Events} from 'ionic/ionic';
|
import {Page, Events} from 'ionic/ionic';
|
||||||
import * as helpers from 'helpers';
|
import * as helpers from './helpers';
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
templateUrl: 'navigation/navigation-details.html'
|
templateUrl: 'navigation/navigation-details.html'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {NavController, NavParams} from 'ionic/ionic';
|
import {NavController, NavParams} from 'ionic/ionic';
|
||||||
import {Page, ViewController} from 'ionic/ionic';
|
import {Page, ViewController} from 'ionic/ionic';
|
||||||
import * as helpers from 'helpers';
|
import * as helpers from './helpers';
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
template: 'Hello 1',
|
template: 'Hello 1',
|
||||||
|
61
gulpfile.js
61
gulpfile.js
@ -59,7 +59,7 @@ gulp.task('build', function(done) {
|
|||||||
runSequence(
|
runSequence(
|
||||||
'bundle',
|
'bundle',
|
||||||
'e2e',
|
'e2e',
|
||||||
'demos:all',
|
// 'demos:all',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
done
|
done
|
||||||
@ -100,9 +100,9 @@ gulp.task('watch', function(done) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch('demos/**/*', function() {
|
// watch('demos/**/*', function() {
|
||||||
gulp.start('demos:all');
|
// gulp.start('demos:all');
|
||||||
});
|
// });
|
||||||
|
|
||||||
watch('ionic/components/*/test/**/*', function(file) {
|
watch('ionic/components/*/test/**/*', function(file) {
|
||||||
if (file.event === "unlink") {
|
if (file.event === "unlink") {
|
||||||
@ -362,9 +362,9 @@ gulp.task('src.link', function(done) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
watch('demos/**/*', function() {
|
// watch('demos/**/*', function() {
|
||||||
gulp.start('demos:all');
|
// gulp.start('demos:all');
|
||||||
});
|
// });
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('src', function(done){
|
gulp.task('src', function(done){
|
||||||
@ -378,7 +378,7 @@ gulp.task('src', function(done){
|
|||||||
|
|
||||||
require('./scripts/docs/gulp-tasks')(gulp, flags)
|
require('./scripts/docs/gulp-tasks')(gulp, flags)
|
||||||
|
|
||||||
gulp.task('demos', function(){
|
gulp.task('build.demos', function(){
|
||||||
var gulpif = require('gulp-if');
|
var gulpif = require('gulp-if');
|
||||||
var lazypipe = require('lazypipe');
|
var lazypipe = require('lazypipe');
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
@ -387,7 +387,8 @@ gulp.task('demos', function(){
|
|||||||
|
|
||||||
var buildTest = lazypipe()
|
var buildTest = lazypipe()
|
||||||
.pipe(tsc, tscOptions, null, tscReporter)
|
.pipe(tsc, tscOptions, null, tscReporter)
|
||||||
.pipe(babel, getBabelOptions('demos'))
|
.pipe(babel, getBabelOptions('demos', 'common'))
|
||||||
|
// .pipe(babel, getBabelOptions('demos'))
|
||||||
|
|
||||||
var baseIndexTemplate = _.template(fs.readFileSync('scripts/demos/index.template.html'))();
|
var baseIndexTemplate = _.template(fs.readFileSync('scripts/demos/index.template.html'))();
|
||||||
var docsIndexTemplate = _.template(fs.readFileSync('scripts/demos/docs.index.template.html'))();
|
var docsIndexTemplate = _.template(fs.readFileSync('scripts/demos/docs.index.template.html'))();
|
||||||
@ -410,11 +411,49 @@ gulp.task('demos', function(){
|
|||||||
path: path.join(path.dirname(file.path), 'index.html'),
|
path: path.join(path.dirname(file.path), 'index.html'),
|
||||||
}));
|
}));
|
||||||
next(null, file);
|
next(null, file);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('bundle.demos', ['build.demos'], function(done){
|
||||||
|
var glob = require('glob');
|
||||||
|
var webpack = require('webpack');
|
||||||
|
var path = require('path');
|
||||||
|
var _ = require('lodash');
|
||||||
|
|
||||||
|
var numWebpacks = 0;
|
||||||
|
glob('dist/demos/**/index.js', function(err, files){
|
||||||
|
files.forEach(function(file){
|
||||||
|
var config = require('./scripts/demos/webpack.config.js');
|
||||||
|
|
||||||
|
// add our bundle entry, removing previous if necessary
|
||||||
|
// since config is cached
|
||||||
|
if (config.entry.length > 5) {
|
||||||
|
config.entry.pop();
|
||||||
|
}
|
||||||
|
config.entry.push('./' + file);
|
||||||
|
config.output = {
|
||||||
|
filename: path.dirname(file) + '/bundle.js'
|
||||||
|
}
|
||||||
|
|
||||||
|
// pretty sure this is a race, but it works
|
||||||
|
numWebpacks++;
|
||||||
|
webpack(config, function(err, stats){
|
||||||
|
// var statsOptions = {
|
||||||
|
// 'colors': true,
|
||||||
|
// 'modules': true,
|
||||||
|
// 'chunks': false,
|
||||||
|
// 'exclude': ['node_modules'],
|
||||||
|
// 'errorDetails': true
|
||||||
|
// }
|
||||||
|
// console.log(stats.toString(statsOptions));
|
||||||
|
if (--numWebpacks === 0) done();
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('demos', ['bundle.demos']);
|
||||||
|
|
||||||
gulp.task('demos:all', ['demos'], function() {
|
gulp.task('demos:all', ['demos'], function() {
|
||||||
return gulp
|
return gulp
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
"through2": "^0.6.3",
|
"through2": "^0.6.3",
|
||||||
"typescript": "1.6.2",
|
"typescript": "1.6.2",
|
||||||
"vinyl": "^0.4.6",
|
"vinyl": "^0.4.6",
|
||||||
|
"webpack": "^1.12.2",
|
||||||
"yargs": "^3.6.0"
|
"yargs": "^3.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,9 @@
|
|||||||
<ion-app>
|
<ion-app>
|
||||||
<ion-loading-icon></ion-loading-icon>
|
<ion-loading-icon></ion-loading-icon>
|
||||||
</ion-app>
|
</ion-app>
|
||||||
|
<script src="bundle.js"></script>
|
||||||
|
|
||||||
<script src="/js/ionic.bundle.js"></script>
|
<!-- <script src="/js/ionic.bundle.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
System.config({
|
System.config({
|
||||||
@ -27,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
System.import("index");
|
System.import("index");
|
||||||
</script>
|
</script> -->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
<ion-loading-icon></ion-loading-icon>
|
<ion-loading-icon></ion-loading-icon>
|
||||||
</ion-app>
|
</ion-app>
|
||||||
|
|
||||||
<script src="../../js/ionic.bundle.js"></script>
|
<script src="bundle.js"></script>
|
||||||
|
<!-- <script src="../../js/ionic.bundle.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
System.config({
|
System.config({
|
||||||
@ -26,7 +27,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
System.import("index");
|
System.import("index");
|
||||||
</script>
|
</script> -->
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
27
scripts/demos/webpack.config.js
Normal file
27
scripts/demos/webpack.config.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
module.exports = {
|
||||||
|
entry: [
|
||||||
|
"zone.js",
|
||||||
|
"reflect-metadata",
|
||||||
|
"angular2/angular2",
|
||||||
|
"ionic/ionic",
|
||||||
|
"web-animations.min",
|
||||||
|
],
|
||||||
|
module: {
|
||||||
|
loaders: [
|
||||||
|
{
|
||||||
|
test: /\.ts$/,
|
||||||
|
loader: "awesome-typescript-loader",
|
||||||
|
include: /\/demos\//,
|
||||||
|
exclude: /node_modules/
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
modulesDirectories: [
|
||||||
|
"node_modules",
|
||||||
|
"dist/src/es5/common", // ionic-framework npm package (stable)
|
||||||
|
"dist/js" // for web-animations polyfill
|
||||||
|
],
|
||||||
|
extensions: ["", ".js", ".ts"]
|
||||||
|
}
|
||||||
|
};
|
Reference in New Issue
Block a user