2022-05-09 14:27:15 +02:00
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
2020-05-26 04:50:53 +02:00
|
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
2022-05-09 14:42:39 +02:00
|
|
|
const path = require("path");
|
2020-05-25 12:01:32 +02:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: "./src/css/tailwind.src.css",
|
|
|
|
mode: process.env.NODE_ENV,
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
2022-05-09 14:27:15 +02:00
|
|
|
use: [MiniCssExtractPlugin.loader, "css-loader", "postcss-loader"],
|
2020-05-25 12:01:32 +02:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2022-05-09 14:42:39 +02:00
|
|
|
devServer: {
|
|
|
|
static: "./dist",
|
|
|
|
watchFiles: path.join(__dirname, "src"),
|
|
|
|
hot: true,
|
|
|
|
},
|
2020-05-25 12:01:32 +02:00
|
|
|
plugins: [
|
2022-05-09 14:27:15 +02:00
|
|
|
new MiniCssExtractPlugin(),
|
2020-05-25 12:01:32 +02:00
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
filename: "index.html",
|
|
|
|
template: "src/index.html",
|
|
|
|
}),
|
|
|
|
/// Enable images folder
|
2022-05-09 14:27:15 +02:00
|
|
|
new CopyWebpackPlugin({
|
|
|
|
patterns: [
|
|
|
|
{
|
|
|
|
from: "src/images",
|
|
|
|
to: "images",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
from: "src/js",
|
|
|
|
to: "js",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}),
|
2020-05-25 12:01:32 +02:00
|
|
|
],
|
2020-05-26 04:50:53 +02:00
|
|
|
};
|