mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 21:45:00 +03:00
52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
const path = require("path");
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
const CopyPlugin = require("copy-webpack-plugin");
|
|
module.exports = {
|
|
mode: "production",
|
|
entry: "./src/000_index.tsx",
|
|
resolve: {
|
|
extensions: [".ts", ".tsx", ".js"],
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: [/\.ts$/, /\.tsx$/],
|
|
use: [
|
|
{
|
|
loader: "babel-loader",
|
|
options: {
|
|
presets: ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
|
|
plugins: ["@babel/plugin-transform-runtime"],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /\.html$/,
|
|
loader: "html-loader",
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ["style-loader", { loader: "css-loader", options: { importLoaders: 1 } }, "postcss-loader"],
|
|
},
|
|
|
|
],
|
|
},
|
|
output: {
|
|
filename: "index.js",
|
|
path: path.resolve(__dirname, "dist"),
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: path.resolve(__dirname, "public/index.html"),
|
|
filename: "./index.html",
|
|
}),
|
|
new CopyPlugin({
|
|
patterns: [{ from: "public/assets", to: "assets" }],
|
|
}),
|
|
new CopyPlugin({
|
|
patterns: [{ from: "public/favicon.ico", to: "favicon.ico" }],
|
|
}),
|
|
]
|
|
};
|