aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2022-12-26 18:39:38 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2022-12-26 18:39:38 +0100
commit2515255a41b649a8ef47a3ed407abc8b19feeaf6 (patch)
tree7f58d3e5bff68fb001e9124982408319f79d9c0c
parentb2c3fecbd146f08711cf9ef1054f68e048f6cd1e (diff)
chore: Add Webpack configuration
-rw-r--r--webpack.config.js44
1 files changed, 44 insertions, 0 deletions
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]'
+ }
+ }
+ ]
+ }
+}