summaryrefslogtreecommitdiffstats
path: root/js/gulpfile.js
diff options
context:
space:
mode:
authorTucker McKnight <tucker.mcknight@gmail.com>2021-07-03 15:34:11 -0600
committerBenjamin Brahmer <info@b-brahmer.de>2021-07-19 14:58:49 +0200
commit8809bb2c560c08fac4b099edaa32b23bd103725d (patch)
tree20f3824328f23935af20da33dada5208cc055f8b /js/gulpfile.js
parent2b9c45df4080be1ab730de6f532d10dab364dd90 (diff)
Add Vue and ng-vue packages
Also adds related parts for compiling Vue components into the existing Javascript bundle. Signed-off-by: Tucker McKnight <tucker.mcknight@gmail.com>
Diffstat (limited to 'js/gulpfile.js')
-rw-r--r--js/gulpfile.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/js/gulpfile.js b/js/gulpfile.js
index e5109cd97..299918986 100644
--- a/js/gulpfile.js
+++ b/js/gulpfile.js
@@ -17,7 +17,9 @@ const gulp = require('gulp'),
jshint = require('gulp-jshint'),
KarmaServer = require('karma').Server,
concat = require('gulp-concat'),
- sourcemaps = require('gulp-sourcemaps');
+ sourcemaps = require('gulp-sourcemaps'),
+ webpackStream = require('webpack-stream'),
+ webpackConfig = require('./webpack.config.js');
// Configuration
const buildTarget = 'app.min.js';
@@ -30,6 +32,8 @@ const sources = [
'node_modules/angular-sanitize/angular-sanitize.min.js',
'node_modules/moment/min/moment-with-locales.min.js',
'node_modules/masonry-layout/dist/masonry.pkgd.min.js',
+ 'node_modules/vue/dist/vue.js',
+ 'node_modules/ngVue/build/index.js',
'app/App.js', 'app/Config.js', 'app/Run.js',
'controller/**/*.js',
'filter/**/*.js',
@@ -40,8 +44,10 @@ const sources = [
'directive/**/*.js'
];
const testSources = ['tests/**/*.js'];
-const watchSources = sources.concat(testSources).concat(['*.js']);
-const lintSources = watchSources;
+const watchSources = sources.concat(testSources);
+const lintSources = watchSources.filter((item) => {
+ return item !== 'webpack.config.js';
+});
// tasks
gulp.task('lint', () => {
@@ -51,8 +57,12 @@ gulp.task('lint', () => {
.pipe(jshint.reporter('fail'));
});
-gulp.task('default', gulp.series('lint', () => {
- return gulp.src(sources)
+gulp.task('webpack', () => {
+ return webpackStream(webpackConfig)
+ .pipe(gulp.dest('./webpacked'));
+});
+gulp.task('default', gulp.series('lint', 'webpack', () => {
+ return gulp.src(sources.concat(['webpacked/webpacked_vue_components.js']))
.pipe(ngAnnotate())
.pipe(sourcemaps.init())
.pipe(concat(buildTarget))