mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Bring back standalone mode and always inject JS
This commit is contained in:
parent
f48d06291a
commit
ff848727e3
3 changed files with 28 additions and 9 deletions
|
@ -8,6 +8,8 @@ jobs:
|
||||||
BuildConfiguration: development
|
BuildConfiguration: development
|
||||||
Production:
|
Production:
|
||||||
BuildConfiguration: production
|
BuildConfiguration: production
|
||||||
|
Standalone:
|
||||||
|
BuildConfiguration: standalone
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
@ -37,6 +39,10 @@ jobs:
|
||||||
displayName: 'Build Production'
|
displayName: 'Build Production'
|
||||||
condition: eq(variables['BuildConfiguration'], 'production')
|
condition: eq(variables['BuildConfiguration'], 'production')
|
||||||
|
|
||||||
|
- script: 'yarn build:standalone'
|
||||||
|
displayName: 'Build Standalone'
|
||||||
|
condition: eq(variables['BuildConfiguration'], 'standalone')
|
||||||
|
|
||||||
- script: 'test -d dist'
|
- script: 'test -d dist'
|
||||||
displayName: 'Check Build'
|
displayName: 'Check Build'
|
||||||
|
|
||||||
|
|
30
gulpfile.js
30
gulpfile.js
|
@ -16,6 +16,7 @@ const stream = require('webpack-stream');
|
||||||
const inject = require('gulp-inject');
|
const inject = require('gulp-inject');
|
||||||
const postcss = require('gulp-postcss');
|
const postcss = require('gulp-postcss');
|
||||||
const sass = require('gulp-sass');
|
const sass = require('gulp-sass');
|
||||||
|
const gulpif = require('gulp-if');
|
||||||
const lazypipe = require('lazypipe');
|
const lazypipe = require('lazypipe');
|
||||||
|
|
||||||
sass.compiler = require('node-sass');
|
sass.compiler = require('node-sass');
|
||||||
|
@ -67,7 +68,7 @@ function serve() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(options.apploader.query, apploader());
|
watch(options.apploader.query, apploader(true));
|
||||||
|
|
||||||
watch('src/bundle.js', webpack);
|
watch('src/bundle.js', webpack);
|
||||||
|
|
||||||
|
@ -130,12 +131,18 @@ function javascript(query) {
|
||||||
.pipe(browserSync.stream());
|
.pipe(browserSync.stream());
|
||||||
}
|
}
|
||||||
|
|
||||||
function apploader() {
|
function apploader(standalone) {
|
||||||
return src(options.apploader.query, { base: './src/' })
|
function task() {
|
||||||
.pipe(concat('scripts/apploader.js'))
|
return src(options.apploader.query, { base: './src/' })
|
||||||
.pipe(pipelineJavascript())
|
.pipe(gulpif(standalone, concat('scripts/apploader.js')))
|
||||||
.pipe(dest('dist/'))
|
.pipe(pipelineJavascript())
|
||||||
.pipe(browserSync.stream());
|
.pipe(dest('dist/'))
|
||||||
|
.pipe(browserSync.stream());
|
||||||
|
}
|
||||||
|
|
||||||
|
task.displayName = 'apploader';
|
||||||
|
|
||||||
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
function webpack() {
|
function webpack() {
|
||||||
|
@ -183,5 +190,10 @@ function injectBundle() {
|
||||||
.pipe(browserSync.stream());
|
.pipe(browserSync.stream());
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.default = series(clean, parallel(javascript, apploader, webpack, css, html, images, copy), injectBundle);
|
function build(standalone) {
|
||||||
exports.serve = series(exports.default, serve);
|
return series(clean, parallel(javascript, apploader(standalone), webpack, css, html, images, copy));
|
||||||
|
}
|
||||||
|
|
||||||
|
exports.default = series(build(false), injectBundle);
|
||||||
|
exports.standalone = series(build(true), injectBundle);
|
||||||
|
exports.serve = series(exports.standalone, serve);
|
||||||
|
|
|
@ -162,6 +162,7 @@
|
||||||
"prepare": "gulp --production",
|
"prepare": "gulp --production",
|
||||||
"build:development": "gulp --development",
|
"build:development": "gulp --development",
|
||||||
"build:production": "gulp --production",
|
"build:production": "gulp --production",
|
||||||
|
"build:standalone": "gulp standalone --development",
|
||||||
"lint": "eslint \".\"",
|
"lint": "eslint \".\"",
|
||||||
"stylelint": "stylelint \"src/**/*.css\""
|
"stylelint": "stylelint \"src/**/*.css\""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue