Skip to content

Commit

Permalink
Inlining frontend scripts in webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Dec 22, 2024
1 parent 3a73306 commit f51f253
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 170 deletions.
2 changes: 2 additions & 0 deletions frontend.webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import HtmlInlineScriptPlugin from "html-inline-script-webpack-plugin";
import HtmlWebpackPlugin from "html-webpack-plugin";
import path from "path";
import { sveltePreprocess } from "svelte-preprocess";
Expand Down Expand Up @@ -72,6 +73,7 @@ export default (_, options) => ({
minify: false,
template: "src/frontend/index.html",
}),
new HtmlInlineScriptPlugin(),
],
resolve: {
alias: {
Expand Down
2 changes: 0 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import gulp from "gulp";
import filter from "gulp-filter";
import webpack from "webpack-stream";

import backendWebpackConfig from "./backend.webpack.config.js";
Expand All @@ -13,7 +12,6 @@ gulp.task("build:frontend", () =>
gulp
.src("src/frontend/index.ts")
.pipe(webpack(frontendWebpackConfig(undefined, {})))
.pipe(filter(["index.html"]))
.pipe(gulp.dest("dist/")),
);

Expand Down
183 changes: 16 additions & 167 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"eslint-plugin-svelte": "^2.46.1",
"gas-webpack-plugin": "^2.6.0",
"gulp": "^5.0.0",
"gulp-filter": "^9.0.1",
"html-inline-script-webpack-plugin": "^3.2.1",
"html-webpack-plugin": "^5.6.3",
"jest": "^29.7.0",
"npm-run-all": "^4.1.5",
Expand Down

0 comments on commit f51f253

Please sign in to comment.