Skip to content

Commit

Permalink
chore: html webpack plugin public path μ„€μ •
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhokim98 committed Dec 29, 2024
1 parent 6e0101e commit c1d6ef3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 0 additions & 6 deletions client/webpack.common.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import {ModifySourcePlugin, ConcatOperation} from 'modify-source-webpack-plugin';
import {fileURLToPath} from 'url';
Expand Down Expand Up @@ -53,11 +52,6 @@ export default {
],
},
plugins: [
new HtmlWebpackPlugin({
template: './index.html',
hash: true,
favicon: path.resolve(__dirname, 'public/favicon.ico'),
}),
new ForkTsCheckerWebpackPlugin(),
new ModifySourcePlugin({
rules: [
Expand Down
7 changes: 7 additions & 0 deletions client/webpack.dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import common from './webpack.common.mjs';
import {fileURLToPath} from 'url';
import TerserPlugin from 'terser-webpack-plugin';
import {WebpackManifestPlugin} from 'webpack-manifest-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down Expand Up @@ -38,6 +39,12 @@ export default merge(common, {
new Dotenv({
path: '.env.dev',
}),
new HtmlWebpackPlugin({
template: './index.html',
publicPath,
hash: true,
favicon: path.resolve(__dirname, 'public/favicon.ico'),
}),
new WebpackManifestPlugin({
fileName: 'manifest.json',
basePath: './dist/',
Expand Down
6 changes: 6 additions & 0 deletions client/webpack.prod.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Dotenv from 'dotenv-webpack';
import common from './webpack.common.mjs';
import {fileURLToPath} from 'url';
import {sentryWebpackPlugin} from '@sentry/webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand All @@ -22,6 +23,11 @@ export default merge(common, {
new Dotenv({
path: '.env.prod',
}),
new HtmlWebpackPlugin({
template: './index.html',
hash: true,
favicon: path.resolve(__dirname, 'public/favicon.ico'),
}),
sentryWebpackPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'wtc-o6',
Expand Down

0 comments on commit c1d6ef3

Please sign in to comment.