From 3951173441bcb511c8f8ae383002e6992e6409a8 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Sun, 1 Dec 2024 13:12:25 +0100 Subject: chore: add development server for shadow-cljs --- webpack.config.js | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js index ba4fee9..8545ca0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,15 +1,15 @@ -const path = require("path") -const MiniCssExtractPlugin = require("mini-css-extract-plugin") -const RemoveEmptyScriptsPlugin = require("webpack-remove-empty-scripts") -const CopyPlugin = require("copy-webpack-plugin") +const path = require("path"); +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const RemoveEmptyScriptsPlugin = require("webpack-remove-empty-scripts"); +const CopyPlugin = require("copy-webpack-plugin"); module.exports = { mode: process.env.NODE_ENV, entry: { - index: path.resolve(__dirname, "resources/src/styles/index.scss") + index: path.resolve(__dirname, "resources/src/styles/index.scss"), }, output: { - path: path.resolve(__dirname, "resources/public") + path: path.resolve(__dirname, "resources/public"), }, plugins: [ new RemoveEmptyScriptsPlugin(), @@ -20,10 +20,14 @@ module.exports = { patterns: [ { from: path.resolve(__dirname, "resources/src/icons"), - to: "icons" - } - ] - }) + to: "icons", + }, + { + from: path.resolve(__dirname, "resources/src/index.html"), + to: "index.html", + }, + ], + }), ], module: { rules: [ @@ -33,22 +37,22 @@ module.exports = { use: [ MiniCssExtractPlugin.loader, { - loader: 'css-loader', + loader: "css-loader", options: { - importLoaders: 1 - } + importLoaders: 1, + }, }, "postcss-loader", - "sass-loader" - ] + "sass-loader", + ], }, { test: /\.(woff|woff2|eot|ttf|otf)$/i, - type: 'asset/resource', + type: "asset/resource", generator: { - filename: 'fonts/[hash][ext][query]' - } - } - ] - } -} + filename: "fonts/[hash][ext][query]", + }, + }, + ], + }, +}; -- cgit v1.2.3