Skip to content

Commit

Permalink
Merge pull request #559 from woowacourse-teams/feat/#558
Browse files Browse the repository at this point in the history
프론트엔드 캐싱을 위한 빌드 결과물 위치 변경
  • Loading branch information
jaeml06 authored Sep 26, 2024
2 parents bcb7b12 + a4a914a commit bdc4f80
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions frontend/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
entry: './src/index.tsx',

output: {
filename: '[name].[contenthash].js', // 캐시를 위한 해시 추가
filename: 'scripts/[name].[contenthash].js', // 캐시를 위한 해시 추가
chunkFilename: '[name].[contenthash].js',
path: path.resolve(__dirname, 'dist'),
clean: true,
Expand All @@ -19,9 +19,9 @@ module.exports = {
devServer: {
historyApiFallback: true,
open: true,
port:8081
port: 8081,
},

plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, './src/index.html'),
Expand Down Expand Up @@ -57,16 +57,28 @@ module.exports = {
use: ['@svgr/webpack'],
issuer: /\.[jt]sx?$/,
resourceQuery: { not: [/url/] },
generator: {
outputPath: 'svgs/',
publicPath: 'svgs/',
},
},
{
type: 'asset/resource',
resourceQuery: /url/,
}
]
generator: {
outputPath: 'svgs/',
publicPath: 'svgs/',
},
},
],
},
{
test: /\.(png|jpe?g|gif|webp|woff2)$/i,
type: 'asset/resource',
generator: {
outputPath: 'assets/',
publicPath: 'assets/',
},
},
],
},
Expand Down

0 comments on commit bdc4f80

Please sign in to comment.