mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove unused dependencies
This commit is contained in:
parent
29b70854f3
commit
c38a2e6dd0
3 changed files with 125 additions and 5005 deletions
178
gulpfile.js
178
gulpfile.js
|
@ -1,178 +0,0 @@
|
||||||
const { src, dest, series, parallel, watch } = require('gulp');
|
|
||||||
const browserSync = require('browser-sync').create();
|
|
||||||
const del = require('del');
|
|
||||||
const babel = require('gulp-babel');
|
|
||||||
const terser = require('gulp-terser');
|
|
||||||
const htmlmin = require('gulp-htmlmin');
|
|
||||||
const imagemin = require('gulp-imagemin');
|
|
||||||
const sourcemaps = require('gulp-sourcemaps');
|
|
||||||
const mode = require('gulp-mode')({
|
|
||||||
modes: ['development', 'production'],
|
|
||||||
default: 'development',
|
|
||||||
verbose: false
|
|
||||||
});
|
|
||||||
const stream = require('webpack-stream');
|
|
||||||
const inject = require('gulp-inject');
|
|
||||||
const postcss = require('gulp-postcss');
|
|
||||||
const sass = require('gulp-sass');
|
|
||||||
const lazypipe = require('lazypipe');
|
|
||||||
|
|
||||||
sass.compiler = require('node-sass');
|
|
||||||
|
|
||||||
let config;
|
|
||||||
if (mode.production()) {
|
|
||||||
config = require('./webpack.prod.js');
|
|
||||||
} else {
|
|
||||||
config = require('./webpack.dev.js');
|
|
||||||
}
|
|
||||||
|
|
||||||
const options = {
|
|
||||||
javascript: {
|
|
||||||
query: ['src/**/*.js', '!src/bundle.js']
|
|
||||||
},
|
|
||||||
css: {
|
|
||||||
query: ['src/**/*.css', 'src/**/*.scss']
|
|
||||||
},
|
|
||||||
html: {
|
|
||||||
query: ['src/**/*.html', '!src/index.html']
|
|
||||||
},
|
|
||||||
images: {
|
|
||||||
query: ['src/**/*.png', 'src/**/*.jpg', 'src/**/*.gif', 'src/**/*.svg']
|
|
||||||
},
|
|
||||||
copy: {
|
|
||||||
query: ['src/**/*.json', 'src/**/*.ico', 'src/**/*.mp3']
|
|
||||||
},
|
|
||||||
injectBundle: {
|
|
||||||
query: 'src/index.html'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function serve() {
|
|
||||||
browserSync.init({
|
|
||||||
server: {
|
|
||||||
baseDir: './dist'
|
|
||||||
},
|
|
||||||
port: 8080
|
|
||||||
});
|
|
||||||
|
|
||||||
const events = ['add', 'change'];
|
|
||||||
|
|
||||||
watch(options.javascript.query).on('all', function (event, path) {
|
|
||||||
if (events.includes(event)) {
|
|
||||||
javascript(path);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
watch('src/bundle.js', webpack);
|
|
||||||
|
|
||||||
watch(options.css.query).on('all', function (event, path) {
|
|
||||||
if (events.includes(event)) {
|
|
||||||
css(path);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(options.html.query).on('all', function (event, path) {
|
|
||||||
if (events.includes(event)) {
|
|
||||||
html(path);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(options.images.query).on('all', function (event, path) {
|
|
||||||
if (events.includes(event)) {
|
|
||||||
images(path);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(options.copy.query).on('all', function (event, path) {
|
|
||||||
if (events.includes(event)) {
|
|
||||||
copy(path);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(options.injectBundle.query, injectBundle);
|
|
||||||
}
|
|
||||||
|
|
||||||
function clean() {
|
|
||||||
return del(['dist/']);
|
|
||||||
}
|
|
||||||
|
|
||||||
const pipelineJavascript = lazypipe()
|
|
||||||
.pipe(function () {
|
|
||||||
return mode.development(sourcemaps.init({ loadMaps: true }));
|
|
||||||
})
|
|
||||||
.pipe(function () {
|
|
||||||
return babel({
|
|
||||||
presets: [
|
|
||||||
['@babel/preset-env']
|
|
||||||
]
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.pipe(function () {
|
|
||||||
return terser({
|
|
||||||
keep_fnames: true,
|
|
||||||
mangle: false
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.pipe(function () {
|
|
||||||
return mode.development(sourcemaps.write('.'));
|
|
||||||
});
|
|
||||||
|
|
||||||
function javascript(query) {
|
|
||||||
return src(typeof query !== 'function' ? query : options.javascript.query, { base: './src/' })
|
|
||||||
.pipe(pipelineJavascript())
|
|
||||||
.pipe(dest('dist/'))
|
|
||||||
.pipe(browserSync.stream());
|
|
||||||
}
|
|
||||||
|
|
||||||
function webpack() {
|
|
||||||
return stream(config)
|
|
||||||
.pipe(dest('dist/'))
|
|
||||||
.pipe(browserSync.stream());
|
|
||||||
}
|
|
||||||
|
|
||||||
function css(query) {
|
|
||||||
return src(typeof query !== 'function' ? query : options.css.query, { base: './src/' })
|
|
||||||
.pipe(mode.development(sourcemaps.init({ loadMaps: true })))
|
|
||||||
.pipe(sass().on('error', sass.logError))
|
|
||||||
.pipe(postcss())
|
|
||||||
.pipe(mode.development(sourcemaps.write('.')))
|
|
||||||
.pipe(dest('dist/'))
|
|
||||||
.pipe(browserSync.stream());
|
|
||||||
}
|
|
||||||
|
|
||||||
function html(query) {
|
|
||||||
return src(typeof query !== 'function' ? query : options.html.query, { base: './src/' })
|
|
||||||
.pipe(mode.production(htmlmin({ collapseWhitespace: true })))
|
|
||||||
.pipe(dest('dist/'))
|
|
||||||
.pipe(browserSync.stream());
|
|
||||||
}
|
|
||||||
|
|
||||||
function images(query) {
|
|
||||||
return src(typeof query !== 'function' ? query : options.images.query, { base: './src/' })
|
|
||||||
.pipe(mode.production(imagemin()))
|
|
||||||
.pipe(dest('dist/'))
|
|
||||||
.pipe(browserSync.stream());
|
|
||||||
}
|
|
||||||
|
|
||||||
function copy(query) {
|
|
||||||
return src(typeof query !== 'function' ? query : options.copy.query, { base: './src/' })
|
|
||||||
.pipe(dest('dist/'))
|
|
||||||
.pipe(browserSync.stream());
|
|
||||||
}
|
|
||||||
|
|
||||||
function injectBundle() {
|
|
||||||
return src(options.injectBundle.query, { base: './src/' })
|
|
||||||
.pipe(inject(
|
|
||||||
src(['src/scripts/apploader.js'], { read: false }, { base: './src/' }), {
|
|
||||||
relative: true,
|
|
||||||
transform: function (filepath) {
|
|
||||||
return `<script src="${filepath}" defer></script>`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
))
|
|
||||||
.pipe(dest('dist/'))
|
|
||||||
.pipe(browserSync.stream());
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.default = series(clean, parallel(javascript, webpack, css, html, images, copy), injectBundle);
|
|
||||||
exports.serve = series(exports.default, serve);
|
|
23
package.json
23
package.json
|
@ -13,13 +13,11 @@
|
||||||
"@babel/preset-env": "^7.12.1",
|
"@babel/preset-env": "^7.12.1",
|
||||||
"autoprefixer": "^9.8.6",
|
"autoprefixer": "^9.8.6",
|
||||||
"babel-loader": "^8.2.1",
|
"babel-loader": "^8.2.1",
|
||||||
"browser-sync": "^2.26.13",
|
|
||||||
"clean-webpack-plugin": "^3.0.0",
|
"clean-webpack-plugin": "^3.0.0",
|
||||||
"confusing-browser-globals": "^1.0.10",
|
"confusing-browser-globals": "^1.0.10",
|
||||||
"copy-webpack-plugin": "^6.0.3",
|
"copy-webpack-plugin": "^6.0.3",
|
||||||
"css-loader": "^5.0.1",
|
"css-loader": "^5.0.1",
|
||||||
"cssnano": "^4.1.10",
|
"cssnano": "^4.1.10",
|
||||||
"del": "^6.0.0",
|
|
||||||
"eslint": "^7.13.0",
|
"eslint": "^7.13.0",
|
||||||
"eslint-plugin-compat": "^3.5.1",
|
"eslint-plugin-compat": "^3.5.1",
|
||||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||||
|
@ -27,25 +25,12 @@
|
||||||
"eslint-plugin-promise": "^4.2.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"expose-loader": "^1.0.1",
|
"expose-loader": "^1.0.1",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"gulp": "^4.0.2",
|
|
||||||
"gulp-babel": "^8.0.0",
|
|
||||||
"gulp-cli": "^2.3.0",
|
|
||||||
"gulp-concat": "^2.6.1",
|
|
||||||
"gulp-htmlmin": "^5.0.1",
|
|
||||||
"gulp-if": "^3.0.0",
|
|
||||||
"gulp-imagemin": "^7.1.0",
|
|
||||||
"gulp-inject": "^5.0.5",
|
|
||||||
"gulp-mode": "^1.0.2",
|
|
||||||
"gulp-postcss": "^8.0.0",
|
|
||||||
"gulp-sass": "^4.0.2",
|
|
||||||
"gulp-sourcemaps": "^3.0.0",
|
|
||||||
"gulp-terser": "^1.4.1",
|
|
||||||
"html-loader": "^1.1.0",
|
"html-loader": "^1.1.0",
|
||||||
"html-webpack-plugin": "^4.5.0",
|
"html-webpack-plugin": "^4.5.0",
|
||||||
"lazypipe": "^1.0.2",
|
|
||||||
"node-sass": "^5.0.0",
|
|
||||||
"postcss-loader": "^3.0.0",
|
"postcss-loader": "^3.0.0",
|
||||||
"postcss-preset-env": "^6.7.0",
|
"postcss-preset-env": "^6.7.0",
|
||||||
|
"sass": "^1.29.0",
|
||||||
|
"sass-loader": "^10.0.5",
|
||||||
"source-map-loader": "^1.1.1",
|
"source-map-loader": "^1.1.1",
|
||||||
"style-loader": "^2.0.0",
|
"style-loader": "^2.0.0",
|
||||||
"stylelint": "^13.7.2",
|
"stylelint": "^13.7.2",
|
||||||
|
@ -56,7 +41,6 @@
|
||||||
"webpack-cli": "^4.0.0",
|
"webpack-cli": "^4.0.0",
|
||||||
"webpack-dev-server": "^3.11.0",
|
"webpack-dev-server": "^3.11.0",
|
||||||
"webpack-merge": "^4.2.2",
|
"webpack-merge": "^4.2.2",
|
||||||
"webpack-stream": "^6.1.1",
|
|
||||||
"workbox-webpack-plugin": "^5.1.4",
|
"workbox-webpack-plugin": "^5.1.4",
|
||||||
"worker-plugin": "^5.0.0"
|
"worker-plugin": "^5.0.0"
|
||||||
},
|
},
|
||||||
|
@ -71,7 +55,6 @@
|
||||||
"flv.js": "^1.5.0",
|
"flv.js": "^1.5.0",
|
||||||
"headroom.js": "^0.12.0",
|
"headroom.js": "^0.12.0",
|
||||||
"hls.js": "^0.14.16",
|
"hls.js": "^0.14.16",
|
||||||
"howler": "^2.2.1",
|
|
||||||
"intersection-observer": "^0.11.0",
|
"intersection-observer": "^0.11.0",
|
||||||
"jellyfin-apiclient": "^1.4.2",
|
"jellyfin-apiclient": "^1.4.2",
|
||||||
"jellyfin-noto": "https://github.com/jellyfin/jellyfin-noto",
|
"jellyfin-noto": "https://github.com/jellyfin/jellyfin-noto",
|
||||||
|
@ -84,8 +67,6 @@
|
||||||
"page": "^1.11.6",
|
"page": "^1.11.6",
|
||||||
"pdfjs-dist": "2.5.207",
|
"pdfjs-dist": "2.5.207",
|
||||||
"resize-observer-polyfill": "^1.5.1",
|
"resize-observer-polyfill": "^1.5.1",
|
||||||
"sass": "^1.29.0",
|
|
||||||
"sass-loader": "^10.0.5",
|
|
||||||
"screenfull": "^5.0.2",
|
"screenfull": "^5.0.2",
|
||||||
"sortablejs": "^1.12.0",
|
"sortablejs": "^1.12.0",
|
||||||
"swiper": "^6.3.5",
|
"swiper": "^6.3.5",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue