Skip to content

Commit

Permalink
chore: switch to lightningcss
Browse files Browse the repository at this point in the history
As part of Vite's 4.4, lightningCSS is now supported
  • Loading branch information
ferferga committed Aug 16, 2023
1 parent f6d5206 commit 61c2f63
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 64 deletions.
6 changes: 5 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
},
"license": "GPL-3.0-only",
"author": "jellyfin-vue Contributors (https://github.com/jellyfin/jellyfin-vue/graphs/contributors)",
"browserslist": [
"defaults and supports es6-module"
],
"scripts": {
"analyze": "vite build --mode analyze",
"build": "vite build",
Expand Down Expand Up @@ -62,7 +65,7 @@
"@typescript-eslint/eslint-plugin": "6.4.0",
"@typescript-eslint/parser": "6.4.0",
"@vitejs/plugin-vue": "4.2.3",
"autoprefixer": "10.4.15",
"browserslist": "4.21.10",
"confusing-browser-globals": "1.0.11",
"eslint": "8.47.0",
"eslint-import-resolver-typescript": "3.6.0",
Expand All @@ -83,6 +86,7 @@
"eslint-plugin-vue": "9.17.0",
"eslint-plugin-vue-scoped-css": "2.5.0",
"eslint-plugin-you-dont-need-lodash-underscore": "6.12.0",
"lightningcss": "1.21.5",
"rollup-plugin-visualizer": "5.9.2",
"sass": "1.65.1",
"typescript": "5.1.6",
Expand Down
11 changes: 8 additions & 3 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {
import visualizer from 'rollup-plugin-visualizer';
import virtual from '@rollup/plugin-virtual';
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
import autoprefixer from 'autoprefixer';
import browserslist from 'browserslist';
import { browserslistToTargets } from 'lightningcss';
import virtualModules from './scripts/virtual-modules';
import { localeFilesFolder, srcRoot } from './scripts/paths';

Expand Down Expand Up @@ -112,6 +113,7 @@ export default defineConfig(({ mode }): UserConfig => {
*/
target: 'es2022',
cssCodeSplit: false,
cssMinify: 'lightningcss',
modulePreload: false,
reportCompressedSize: false,
rollupOptions: {
Expand Down Expand Up @@ -139,8 +141,11 @@ export default defineConfig(({ mode }): UserConfig => {
}
},
css: {
postcss: {
plugins: [autoprefixer()]
lightningcss: {
nonStandard: {
deepSelectorCombinator: true
},
targets: browserslistToTargets(browserslist())
}
},
preview: {
Expand Down
260 changes: 200 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 61c2f63

Please sign in to comment.