Skip to content

Commit 606126f

Browse files
committed
chore(build): migrate build system from rollup and parcel to vite
Replaces Rollup and Parcel with Vite as the sole build tool in order to reduce complexity. The changes involve: - Removed `.parcelrc` and `rollup.config.js`, as their functionalities are now handled by Vite. - Introduced multiple Vite config to support the various build outputs previously managed by Rollup. - Updated `package.json` to integrate Vite dependencies and remove those related to Rollup and Parcel (2 Rollup plugins have been retained, including Babel to enhance browser compatibility and Terser for minifying the UMD build). - Modified `scss/pillarbox.scss` to enhance compatibility with the new Vite build setup. This update includes simplifying SCSS imports, making it easier to resolve external dependencies without depending on the file's location. - The server previously started by Parcel for the demo pages is now efficiently handled by Vite's native development server.
1 parent 5eee634 commit 606126f

15 files changed

+9024
-14368
lines changed

.parcelrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

package-lock.json

Lines changed: 8885 additions & 14085 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,22 @@
2525
"directories": {
2626
"doc": "docs"
2727
},
28-
"targets": {
29-
"main": false,
30-
"github-page": {
31-
"publicUrl": "./",
32-
"isLibrary": false,
33-
"outputFormat": "esmodule"
34-
}
35-
},
3628
"scripts": {
3729
"build": "npm run build:lib && npm run build:typings && npm run build:css",
3830
"build:css": "sass ./scss/pillarbox.scss:dist/pillarbox.min.css --style compressed --source-map --load-path node_modules",
39-
"build:lib": "rollup -c",
31+
"build:lib": "npm run build:core && npm run build:es && npm run build:cjs && npm run build:umd",
32+
"build:core": "vite build --config vite.config.core.js",
33+
"build:es": "vite build --config vite.config.es.js",
34+
"build:cjs": "vite build --config vite.config.cjs.js",
35+
"build:umd": "vite build --config vite.config.umd.js",
4036
"build:typings": "npx -p typescript tsc",
4137
"eslint": "eslint --ext .js src",
4238
"generate:docs": "jsdoc --configure docs/api/jsdoc.json --verbose",
43-
"github:page": "parcel build index.html --target github-page && npm run generate:docs",
39+
"github:page": "vite build && npm run generate:docs",
4440
"outdated": "npm outdated",
4541
"prebuild": "rimraf dist",
4642
"release:ci": "semantic-release",
47-
"start": "parcel -p 6969 index.html",
43+
"start": "vite --port 6969 --open",
4844
"stylelint": "stylelint **/*.scss --custom-syntax --allow-empty-input",
4945
"stylelint:fix": "stylelint **/*.scss --fix",
5046
"test": "jest --verbose",
@@ -69,11 +65,7 @@
6965
"@babel/preset-env": "^7.24.1",
7066
"@commitlint/cli": "^18.4.3",
7167
"@commitlint/config-conventional": "^18.4.3",
72-
"@parcel/transformer-sass": "^2.11.0",
7368
"@rollup/plugin-babel": "^6.0.4",
74-
"@rollup/plugin-commonjs": "^25.0.7",
75-
"@rollup/plugin-json": "^6.1.0",
76-
"@rollup/plugin-node-resolve": "^15.2.3",
7769
"@rollup/plugin-terser": "^0.4.4",
7870
"@semantic-release/changelog": "^6.0.3",
7971
"@semantic-release/git": "^10.0.1",
@@ -91,16 +83,14 @@
9183
"jest-environment-jsdom": "^29.6.1",
9284
"jsdoc": "^4.0.2",
9385
"jsdoc-tsimport-plugin": "^1.0.5",
94-
"parcel": "^2.11.0",
9586
"rimraf": "^5.0.5",
96-
"rollup": "^4.9.6",
97-
"rollup-plugin-filesize": "^10.0.0",
9887
"sass": "^1.70.0",
9988
"semantic-release": "^23.0.0",
10089
"stylelint": "^16.2.1",
10190
"stylelint-config-rational-order": "^0.1.2",
10291
"stylelint-order": "^6.0.4",
103-
"typescript": "^5.3.3"
92+
"typescript": "^5.3.3",
93+
"vite": "^5.4.10"
10494
},
10595
"dependencies": {
10696
"video.js": "^8.11.8",

rollup.config.js

Lines changed: 0 additions & 246 deletions
This file was deleted.

scss/pillarbox.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../node_modules/video.js/dist/video-js';
1+
@import 'video.js/dist/video-js';
22

33
/*
44
******************************************************************************

src/lang/de.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Pillarbox from '../pillarbox.js';
2-
import * as vjsLang from 'video.js/dist/lang/de.json';
3-
import * as pillarboxLang from './de.json';
2+
import vjsLang from 'video.js/dist/lang/de.json';
3+
import pillarboxLang from './de.json';
44

55
Pillarbox.addLanguage('de', {
66
...vjsLang,

src/lang/en.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Pillarbox from '../pillarbox.js';
2-
import * as vjsLang from 'video.js/dist/lang/en.json';
3-
import * as pillarboxLang from './en.json';
2+
import vjsLang from 'video.js/dist/lang/en.json';
3+
import pillarboxLang from './en.json';
44

55
Pillarbox.addLanguage('en', {
66
...vjsLang,

src/lang/fr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Pillarbox from '../pillarbox.js';
2-
import * as vjsLang from 'video.js/dist/lang/fr.json';
3-
import * as pillarboxLang from './fr.json';
2+
import vjsLang from 'video.js/dist/lang/fr.json';
3+
import pillarboxLang from './fr.json';
44

55
Pillarbox.addLanguage('fr', {
66
...vjsLang,

src/lang/it.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Pillarbox from '../pillarbox.js';
2-
import * as vjsLang from 'video.js/dist/lang/it.json';
3-
import * as pillarboxLang from './it.json';
2+
import vjsLang from 'video.js/dist/lang/it.json';
3+
import pillarboxLang from './it.json';
44

55
Pillarbox.addLanguage('it', {
66
...vjsLang,

src/lang/rm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Pillarbox from '../pillarbox.js';
2-
import * as pillarboxLang from './rm.json';
2+
import pillarboxLang from './rm.json';
33

44
Pillarbox.addLanguage('rm', {
55
...pillarboxLang,

0 commit comments

Comments
 (0)