Skip to content

Commit 59c7019

Browse files
committed
wip
1 parent 5f34d78 commit 59c7019

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ghcjs/miso-functora/webpack.config.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ const TerserPlugin = require("terser-webpack-plugin");
33
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
44
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
55
const RemoveEmptyScriptsPlugin = require("webpack-remove-empty-scripts");
6+
const path = require("path");
7+
const fs = require("fs");
8+
69
const js = {
710
entry: "./js/main.js",
811
output: {
@@ -29,10 +32,16 @@ const js = {
2932
}),
3033
],
3134
};
35+
3236
const css = {
33-
entry: {
34-
paper: "./css/paper.css",
35-
},
37+
entry: fs
38+
.readdirSync("./css")
39+
.filter((file) => file.endsWith(".css"))
40+
.map((file) => [path.basename(file, ".css"), path.join("./css", file)])
41+
.reduce(
42+
(entries, [name, filePath]) => ({ ...entries, [name]: filePath }),
43+
{},
44+
),
3645
output: {
3746
path: __dirname + "/dist/css",
3847
clean: true,

0 commit comments

Comments
 (0)