diff --git a/firebase.json b/firebase.json index a3eaad6..a04bc1c 100644 --- a/firebase.json +++ b/firebase.json @@ -18,7 +18,7 @@ ], "headers": [ { - "source": "**/*.@(jpg|jpeg|gif|png|webm|mp4)", + "source": "**/*.@(jpg|jpeg|webp|png|webm|mp4|gif)", "headers": [ { "key": "Cache-Control", diff --git a/package.json b/package.json index e418dd8..91ff151 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "start": "webpack-dev-server --mode development", "lint": "npx eslint --fix \"src/**/*.ts\" && npx prettier --write \"src/**/*\"", - "build": "webpack --mode production" + "build": "webpack --mode production && rm dist/*.js && rm dist/*.css" }, "repository": { "type": "git", diff --git a/webpack.config.js b/webpack.config.js index f0831a1..e2c4b71 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -45,8 +45,8 @@ module.exports = (env, argv) => ({ }), new HtmlWebpackInlineSourcePlugin(), new MiniCssExtractPlugin({ - filename: '[name].[contenthash].css', - chunkFilename: '[id].[contenthash].css', + filename: '[name].css', + chunkFilename: '[id].css', }), ], entry: { @@ -54,12 +54,12 @@ module.exports = (env, argv) => ({ }, module: { rules: [ - { test: /\.(jpe?g|png)$/i, loader: 'responsive-loader', options: { adapter: Sharp, + name: '[contenthash]-[width].[ext]', outputPath: 'static/', sizes: [200, 400, 800, 1200, 1600, 2000], format: 'webp', @@ -72,6 +72,7 @@ module.exports = (env, argv) => ({ loader: 'file-loader', query: { outputPath: 'static/', + name: '[contenthash].[ext]', }, }, {