Skip to content

Commit

Permalink
Remove rollup build configuration (#22181)
Browse files Browse the repository at this point in the history
Rollup remove
  • Loading branch information
silamon authored Nov 8, 2024
1 parent f396be2 commit ee79c3a
Show file tree
Hide file tree
Showing 28 changed files with 172 additions and 998 deletions.
2 changes: 1 addition & 1 deletion build-scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Home Assistant build pipeline contains various steps to prepare a build.

Currently in Home Assistant we use a bundler to convert TypeScript, CSS and JSON files to JavaScript files that the browser understands.

We currently rely on Webpack but also have experimental Rollup support. Both of these programs bundle the converted files in both production and development.
We currently rely on Webpack. Both of these programs bundle the converted files in both production and development.

For development, bundling is optional. We just want to get the right files in the browser.

Expand Down
13 changes: 6 additions & 7 deletions build-scripts/bundle.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,12 @@ module.exports.config = {
return {
name: "frontend" + nameSuffix(latestBuild),
entry: {
"service-worker":
!env.useRollup() && !latestBuild
? {
import: "./src/entrypoints/service-worker.ts",
layer: "sw",
}
: "./src/entrypoints/service-worker.ts",
"service-worker": !latestBuild
? {
import: "./src/entrypoints/service-worker.ts",
layer: "sw",
}
: "./src/entrypoints/service-worker.ts",
app: "./src/entrypoints/app.ts",
authorize: "./src/entrypoints/authorize.ts",
onboarding: "./src/entrypoints/onboarding.ts",
Expand Down
3 changes: 0 additions & 3 deletions build-scripts/env.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ const path = require("path");
const paths = require("./paths.cjs");

module.exports = {
useRollup() {
return process.env.ROLLUP === "1";
},
useWDS() {
return process.env.WDS === "1";
},
Expand Down
9 changes: 2 additions & 7 deletions build-scripts/gulp/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./entry-html.js";
import "./gather-static.js";
import "./gen-icons-json.js";
import "./locale-data.js";
import "./rollup.js";
import "./service-worker.js";
import "./translations.js";
import "./wds.js";
Expand All @@ -27,11 +26,7 @@ gulp.task(
"build-locale-data"
),
"copy-static-app",
env.useWDS()
? "wds-watch-app"
: env.useRollup()
? "rollup-watch-app"
: "webpack-watch-app"
env.useWDS() ? "wds-watch-app" : "webpack-watch-app"
)
);

Expand All @@ -44,7 +39,7 @@ gulp.task(
"clean",
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-app",
env.useRollup() ? "rollup-prod-app" : "webpack-prod-app",
"webpack-prod-app",
gulp.parallel("gen-pages-app-prod", "gen-service-worker-app-prod"),
// Don't compress running tests
...(env.isTestBuild() ? [] : ["compress-app"])
Expand Down
6 changes: 2 additions & 4 deletions build-scripts/gulp/cast.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import gulp from "gulp";
import env from "../env.cjs";
import "./clean.js";
import "./entry-html.js";
import "./gather-static.js";
import "./rollup.js";
import "./service-worker.js";
import "./translations.js";
import "./webpack.js";
Expand All @@ -19,7 +17,7 @@ gulp.task(
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-cast",
"gen-pages-cast-dev",
env.useRollup() ? "rollup-dev-server-cast" : "webpack-dev-server-cast"
"webpack-dev-server-cast"
)
);

Expand All @@ -33,7 +31,7 @@ gulp.task(
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-cast",
env.useRollup() ? "rollup-prod-cast" : "webpack-prod-cast",
"webpack-prod-cast",
"gen-pages-cast-prod"
)
);
6 changes: 2 additions & 4 deletions build-scripts/gulp/demo.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import gulp from "gulp";
import env from "../env.cjs";
import "./clean.js";
import "./entry-html.js";
import "./gather-static.js";
import "./gen-icons-json.js";
import "./rollup.js";
import "./service-worker.js";
import "./translations.js";
import "./webpack.js";
Expand All @@ -24,7 +22,7 @@ gulp.task(
"build-locale-data"
),
"copy-static-demo",
env.useRollup() ? "rollup-dev-server-demo" : "webpack-dev-server-demo"
"webpack-dev-server-demo"
)
);

Expand All @@ -39,7 +37,7 @@ gulp.task(
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-demo",
env.useRollup() ? "rollup-prod-demo" : "webpack-prod-demo",
"webpack-prod-demo",
"gen-pages-demo-prod"
)
);
1 change: 0 additions & 1 deletion build-scripts/gulp/entry-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const getCommonTemplateVars = () => {
{ ignorePatch: true, allowHigherVersions: true }
);
return {
useRollup: env.useRollup(),
useWDS: env.useWDS(),
modernRegex: compileRegex(browserRegexes.concat(haMacOSRegex)).toString(),
};
Expand Down
8 changes: 2 additions & 6 deletions build-scripts/gulp/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import gulp from "gulp";
import yaml from "js-yaml";
import { marked } from "marked";
import path from "path";
import env from "../env.cjs";
import paths from "../paths.cjs";
import "./clean.js";
import "./entry-html.js";
import "./gather-static.js";
import "./gen-icons-json.js";
import "./rollup.js";
import "./service-worker.js";
import "./translations.js";
import "./webpack.js";
Expand Down Expand Up @@ -158,9 +156,7 @@ gulp.task(
"copy-static-gallery",
"gen-pages-gallery-dev",
gulp.parallel(
env.useRollup()
? "rollup-dev-server-gallery"
: "webpack-dev-server-gallery",
"webpack-dev-server-gallery",
async function watchMarkdownFiles() {
gulp.watch(
[
Expand Down Expand Up @@ -189,7 +185,7 @@ gulp.task(
"gather-gallery-pages"
),
"copy-static-gallery",
env.useRollup() ? "rollup-prod-gallery" : "webpack-prod-gallery",
"webpack-prod-gallery",
"gen-pages-gallery-prod"
)
);
4 changes: 0 additions & 4 deletions build-scripts/gulp/gather-static.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import fs from "fs-extra";
import gulp from "gulp";
import path from "path";
import paths from "../paths.cjs";
import env from "../env.cjs";

const npmPath = (...parts) =>
path.resolve(paths.polymer_dir, "node_modules", ...parts);
Expand Down Expand Up @@ -69,9 +68,6 @@ function copyPolyfills(staticDir) {
}

function copyLoaderJS(staticDir) {
if (!env.useRollup()) {
return;
}
const staticPath = genStaticPath(staticDir);
copyFileDir(npmPath("systemjs/dist/s.min.js"), staticPath("js"));
copyFileDir(npmPath("systemjs/dist/s.min.js.map"), staticPath("js"));
Expand Down
5 changes: 2 additions & 3 deletions build-scripts/gulp/hassio.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "./compress.js";
import "./entry-html.js";
import "./gather-static.js";
import "./gen-icons-json.js";
import "./rollup.js";
import "./translations.js";
import "./webpack.js";

Expand All @@ -22,7 +21,7 @@ gulp.task(
"copy-translations-supervisor",
"build-locale-data",
"copy-static-supervisor",
env.useRollup() ? "rollup-watch-hassio" : "webpack-watch-hassio"
"webpack-watch-hassio"
)
);

Expand All @@ -38,7 +37,7 @@ gulp.task(
"copy-translations-supervisor",
"build-locale-data",
"copy-static-supervisor",
env.useRollup() ? "rollup-prod-hassio" : "webpack-prod-hassio",
"webpack-prod-hassio",
"gen-pages-hassio-prod",
...// Don't compress running tests
(env.isTestBuild() ? [] : ["compress-hassio"])
Expand Down
147 changes: 0 additions & 147 deletions build-scripts/gulp/rollup.js

This file was deleted.

14 changes: 0 additions & 14 deletions build-scripts/rollup-plugins/dont-hash-plugin.cjs

This file was deleted.

24 changes: 0 additions & 24 deletions build-scripts/rollup-plugins/ignore-plugin.cjs

This file was deleted.

Loading

0 comments on commit ee79c3a

Please sign in to comment.