Skip to content

Commit 169936e

Browse files
committed
Add ngVue package and a demo component
1 parent 7eb3449 commit 169936e

File tree

6 files changed

+355
-8
lines changed

6 files changed

+355
-8
lines changed

js/app/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ $('#content.app-news')
1515
.attr('ng-controller', 'AppController as App');
1616

1717
/* jshint unused: false */
18-
var app = angular.module('News', ['ngRoute', 'ngSanitize', 'ngAnimate']);
18+
var app = angular.module('News', ['ngRoute', 'ngSanitize', 'ngAnimate', 'ngVue']);

js/controller/AppController.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ app.controller('AppController', function (Loading, FeedResource, FolderResource)
1919
this.play = function (item) {
2020
this.playingItem = item;
2121
};
22+
23+
this.t = window.t;
2224
});

js/gulpfile.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const gulp = require('gulp'),
1717
jshint = require('gulp-jshint'),
1818
KarmaServer = require('karma').Server,
1919
concat = require('gulp-concat'),
20-
sourcemaps = require('gulp-sourcemaps');
20+
sourcemaps = require('gulp-sourcemaps'),
21+
webpackStream = require('webpack-stream'),
22+
webpackConfig = require('./webpack.config.js');
2123

2224
// Configuration
2325
const buildTarget = 'app.min.js';
@@ -29,6 +31,8 @@ const sources = [
2931
'node_modules/angular-route/angular-route.min.js',
3032
'node_modules/angular-sanitize/angular-sanitize.min.js',
3133
'node_modules/masonry-layout/dist/masonry.pkgd.min.js',
34+
'node_modules/vue/dist/vue.js',
35+
'node_modules/ngVue/build/index.js',
3236
'app/App.js', 'app/Config.js', 'app/Run.js',
3337
'controller/**/*.js',
3438
'filter/**/*.js',
@@ -39,8 +43,10 @@ const sources = [
3943
'directive/**/*.js'
4044
];
4145
const testSources = ['tests/**/*.js'];
42-
const watchSources = sources.concat(testSources).concat(['*.js']);
43-
const lintSources = watchSources;
46+
const watchSources = sources.concat(testSources);
47+
const lintSources = watchSources.filter((item) => {
48+
return item !== 'webpack.config.js';
49+
});
4450

4551
// tasks
4652
gulp.task('lint', () => {
@@ -50,8 +56,12 @@ gulp.task('lint', () => {
5056
.pipe(jshint.reporter('fail'));
5157
});
5258

53-
gulp.task('default', gulp.series('lint', () => {
54-
return gulp.src(sources)
59+
gulp.task('webpack', () => {
60+
return webpackStream(webpackConfig)
61+
.pipe(gulp.dest('./webpacked'));
62+
});
63+
gulp.task('default', gulp.series('lint', 'webpack', () => {
64+
return gulp.src(sources.concat(['webpacked/webpacked_vue_components.js']))
5565
.pipe(ngAnnotate())
5666
.pipe(sourcemaps.init())
5767
.pipe(concat(buildTarget))

0 commit comments

Comments
 (0)