From 2515255a41b649a8ef47a3ed407abc8b19feeaf6 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Mon, 26 Dec 2022 18:39:38 +0100 Subject: chore: Add Webpack configuration --- webpack.config.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 webpack.config.js diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..9bc34f8 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,44 @@ +const path = require("path") +const MiniCssExtractPlugin = require("mini-css-extract-plugin") +const RemoveEmptyScriptsPlugin = require("webpack-remove-empty-scripts") + +module.exports = { + mode: process.env.NODE_ENV, + entry: { + tau: "./resources/src/css/tau.scss" + }, + output: { + path: path.resolve(__dirname, "resources/public") + }, + plugins: [ + new RemoveEmptyScriptsPlugin(), + new MiniCssExtractPlugin({ + filename: "css/[name].css", + }) + ], + module: { + rules: [ + { + test: /\.scss$/i, + use: [ + MiniCssExtractPlugin.loader, + { + loader: 'css-loader', + options: { + importLoaders: 1 + } + }, + "postcss-loader", + "sass-loader" + ] + }, + { + test: /\.(woff|woff2|eot|ttf|otf)$/i, + type: 'asset/resource', + generator: { + filename: 'fonts/[hash][ext][query]' + } + } + ] + } +} -- cgit v1.2.3