mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 02:48:19 -07:00
commit
0335f61cc1
@ -13,8 +13,8 @@ pr:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
- job: main_build
|
||||
displayName: 'Main Build'
|
||||
- job: build
|
||||
displayName: 'Build'
|
||||
|
||||
dependsOn: lint
|
||||
condition: succeeded()
|
||||
@ -22,6 +22,14 @@ jobs:
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
bundle:
|
||||
BuildConfiguration: Bundle
|
||||
standalone:
|
||||
BuildConfiguration: Standalone
|
||||
maxParallel: 2
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
displayName: 'Install Node'
|
||||
@ -65,6 +73,5 @@ jobs:
|
||||
- script: 'yarn run lint'
|
||||
displayName: 'Run ESLint'
|
||||
|
||||
- script: |
|
||||
yarn run stylelint
|
||||
displayName: 'Run stylelint'
|
||||
- script: 'yarn run stylelint'
|
||||
displayName: 'Run Stylelint'
|
||||
|
@ -1,5 +1,5 @@
|
||||
env:
|
||||
es6: false
|
||||
es6: true
|
||||
browser: true
|
||||
amd: true
|
||||
|
||||
|
22
gulpfile.js
22
gulpfile.js
@ -10,11 +10,11 @@ const htmlmin = require('gulp-htmlmin');
|
||||
const imagemin = require('gulp-imagemin');
|
||||
const sourcemaps = require('gulp-sourcemaps');
|
||||
const mode = require('gulp-mode')({
|
||||
modes: ["production", "development"],
|
||||
modes: ["development", "bundle", "standalone"],
|
||||
default: "development",
|
||||
verbose: false
|
||||
});
|
||||
const webpack_stream = require('webpack-stream');
|
||||
const stream = require('webpack-stream');
|
||||
const inject = require('gulp-inject');
|
||||
const postcss = require('gulp-postcss');
|
||||
const sass = require('gulp-sass');
|
||||
@ -22,10 +22,10 @@ const sass = require('gulp-sass');
|
||||
sass.compiler = require('node-sass')
|
||||
|
||||
|
||||
if (mode.production()) {
|
||||
var webpack_config = require('./webpack.prod.js');
|
||||
if (mode.bundle() || mode.standalone()) {
|
||||
var config = require('./webpack.prod.js');
|
||||
} else {
|
||||
var webpack_config = require('./webpack.dev.js');
|
||||
var config = require('./webpack.dev.js');
|
||||
}
|
||||
|
||||
function serve() {
|
||||
@ -43,16 +43,15 @@ function serve() {
|
||||
watch(['src/**/*.png', 'src/**/*.jpg', 'src/**/*.gif', 'src/**/*.svg'], images);
|
||||
watch(['src/**/*.json', 'src/**/*.ico'], copy);
|
||||
watch('src/index.html', injectBundle);
|
||||
watch(['src/standalone.js', 'src/scripts/apploader.js'], setStandalone);
|
||||
watch(['src/standalone.js', 'src/scripts/apploader.js'], standalone);
|
||||
}
|
||||
|
||||
function setStandalone() {
|
||||
function standalone() {
|
||||
return src(['src/standalone.js', 'src/scripts/apploader.js'], { base: './src/' })
|
||||
.pipe(concat('scripts/apploader.js'))
|
||||
.pipe(dest('dist/'));
|
||||
}
|
||||
|
||||
// Clean assets
|
||||
function clean() {
|
||||
return del(['dist/']);
|
||||
}
|
||||
@ -75,7 +74,7 @@ function javascript() {
|
||||
}
|
||||
|
||||
function webpack() {
|
||||
return webpack_stream(webpack_config)
|
||||
return stream(config)
|
||||
.pipe(dest('dist/'))
|
||||
.pipe(browserSync.stream());
|
||||
}
|
||||
@ -92,7 +91,8 @@ function css() {
|
||||
|
||||
function html() {
|
||||
return src(['src/**/*.html', '!src/index.html'], { base: './src/' })
|
||||
.pipe(mode.production(htmlmin({ collapseWhitespace: true })))
|
||||
.pipe(mode.bundle(htmlmin({ collapseWhitespace: true })))
|
||||
.pipe(mode.standalone(htmlmin({ collapseWhitespace: true })))
|
||||
.pipe(dest('dist/'))
|
||||
.pipe(browserSync.stream());
|
||||
}
|
||||
@ -120,4 +120,4 @@ function injectBundle() {
|
||||
}
|
||||
|
||||
exports.default = series(clean, parallel(javascript, webpack, css, html, images, copy), injectBundle)
|
||||
exports.serve = series(exports.default, setStandalone, serve)
|
||||
exports.serve = series(exports.default, standalone, serve)
|
||||
|
@ -90,8 +90,9 @@
|
||||
],
|
||||
"scripts": {
|
||||
"serve": "gulp serve",
|
||||
"build": "gulp --production",
|
||||
"build dev": "gulp",
|
||||
"build": "gulp --bundle",
|
||||
"build standalone": "gulp --standalone",
|
||||
"build development": "gulp",
|
||||
"lint": "eslint \"src\"",
|
||||
"stylelint": "stylelint \"src/**/*.css\""
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user