🚀 improve demos

This commit is contained in:
platane
2020-10-24 10:48:18 +02:00
parent 64b04e9eba
commit a9c2cbc763
9 changed files with 71 additions and 54 deletions

View File

@@ -3,10 +3,6 @@ import HtmlWebpackPlugin from "html-webpack-plugin";
import type { Configuration } from "webpack";
const basePathname = (process.env.BASE_PATHNAME || "")
.split("/")
.filter(Boolean);
const demos: string[] = require("./demo.json");
const config: Configuration = {
@@ -18,7 +14,6 @@ const config: Configuration = {
output: {
path: path.join(__dirname, "dist"),
filename: "[contenthash].js",
publicPath: "/" + basePathname.map((x) => x + "/").join(""),
},
module: {
rules: [
@@ -40,6 +35,7 @@ const config: Configuration = {
...demos.map(
(demo) =>
new HtmlWebpackPlugin({
title: "snk - " + demo,
filename: `${demo}.html`,
chunks: [demo],
})