mirror of
https://github.com/DaanVandenBosch/phantasmal-world.git
synced 2025-04-04 22:58:29 +08:00
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
const common = require("./webpack.common.js");
|
|
const path = require("path");
|
|
const { merge } = require("webpack-merge");
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
const Dotenv = require("dotenv-webpack");
|
|
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
|
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
|
|
module.exports = merge(common, {
|
|
mode: "production",
|
|
output: {
|
|
filename: "[name].[contenthash].js",
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ts$/,
|
|
loader: "ts-loader",
|
|
include: path.resolve(__dirname, "src"),
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: [MiniCssExtractPlugin.loader, "css-loader"],
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new CleanWebpackPlugin(),
|
|
new Dotenv({
|
|
path: "./.env.prod",
|
|
}),
|
|
new MiniCssExtractPlugin({
|
|
ignoreOrder: true,
|
|
filename: "[name].[contenthash].css",
|
|
}),
|
|
new CopyWebpackPlugin({
|
|
patterns: [
|
|
{
|
|
from: path.resolve(__dirname, "assets"),
|
|
to: path.resolve(__dirname, "dist/assets"),
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
});
|