1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix issues with standalone build

This commit is contained in:
dkanada 2020-03-17 02:12:05 +09:00
parent fa5e1feaab
commit 3958548b1f
3 changed files with 13 additions and 13 deletions

View file

@ -23,8 +23,8 @@ jobs:
matrix:
Development:
BuildConfiguration: development
Bundle:
BuildConfiguration: bundle
Production:
BuildConfiguration: production
Standalone:
BuildConfiguration: standalone
maxParallel: 3
@ -50,9 +50,9 @@ jobs:
displayName: 'Build Development'
condition: eq(variables['BuildConfiguration'], 'development')
- script: 'yarn build:bundle'
- script: 'yarn build:production'
displayName: 'Build Bundle'
condition: eq(variables['BuildConfiguration'], 'bundle')
condition: eq(variables['BuildConfiguration'], 'production')
- script: 'yarn build:standalone'
displayName: 'Build Standalone'

View file

@ -10,7 +10,7 @@ const htmlmin = require('gulp-htmlmin');
const imagemin = require('gulp-imagemin');
const sourcemaps = require('gulp-sourcemaps');
const mode = require('gulp-mode')({
modes: ["development", "bundle", "standalone"],
modes: ["development", "production"],
default: "development",
verbose: false
});
@ -22,7 +22,7 @@ const sass = require('gulp-sass');
sass.compiler = require('node-sass')
if (mode.bundle() || mode.standalone()) {
if (mode.production()) {
var config = require('./webpack.prod.js');
} else {
var config = require('./webpack.dev.js');
@ -91,15 +91,14 @@ function css() {
function html() {
return src(['src/**/*.html', '!src/index.html'], { base: './src/' })
.pipe(mode.bundle(htmlmin({ collapseWhitespace: true })))
.pipe(mode.standalone(htmlmin({ collapseWhitespace: true })))
.pipe(mode.production(htmlmin({ collapseWhitespace: true })))
.pipe(dest('dist/'))
.pipe(browserSync.stream());
}
function images() {
return src(['src/**/*.png', 'src/**/*.jpg', 'src/**/*.gif', 'src/**/*.svg'], { base: './src/' })
.pipe(imagemin())
.pipe(mode.production(imagemin()))
.pipe(dest('dist/'))
.pipe(browserSync.stream());
}
@ -120,4 +119,5 @@ function injectBundle() {
}
exports.default = series(clean, parallel(javascript, webpack, css, html, images, copy), injectBundle)
exports.serve = series(exports.default, standalone, serve)
exports.standalone = series(exports.default, standalone)
exports.serve = series(exports.standalone, serve)

View file

@ -90,10 +90,10 @@
],
"scripts": {
"serve": "gulp serve",
"prepare": "gulp --bundle",
"prepare": "gulp --production",
"build:development": "gulp --development",
"build:bundle": "gulp --bundle",
"build:standalone": "gulp --standalone",
"build:production": "gulp --production",
"build:standalone": "gulp standalone --development",
"lint": "eslint \"src\"",
"stylelint": "stylelint \"src/**/*.css\""
}