Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit 8a6c5e0

Browse files
committed
chore: add copy plugin and include image assets
1 parent 6b91c10 commit 8a6c5e0

File tree

3 files changed

+96
-1
lines changed

3 files changed

+96
-1
lines changed

package-lock.json

Lines changed: 82 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"@types/react-router-dom": "^5.1.6",
6161
"babel-loader": "^8.1.0",
6262
"compression-webpack-plugin": "^6.0.3",
63+
"copy-webpack-plugin": "^6.2.1",
6364
"css-loader": "^4.3.0",
6465
"dts-minify": "^0.2.0",
6566
"eslint-config-prettier": "^6.12.0",

webpack.base.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require("path");
22
const HtmlPlugin = require("html-webpack-plugin");
33
const webpack = require("webpack");
44
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
5+
const CopyPlugin = require("copy-webpack-plugin");
56

67
module.exports = {
78
module: {
@@ -43,6 +44,13 @@ module.exports = {
4344
test: /\.css$/,
4445
use: ["style-loader", "css-loader"],
4546
},
47+
{
48+
test: /\.png$/,
49+
loader: "file-loader",
50+
options: {
51+
outputPath: "assets",
52+
},
53+
},
4654
],
4755
},
4856
resolve: {
@@ -73,6 +81,11 @@ module.exports = {
7381
filename: "./index.html",
7482
}),
7583
new FaviconsWebpackPlugin(path.resolve(__dirname, "./assets/favicon.png")),
84+
new CopyPlugin({
85+
patterns: [
86+
{ from: path.resolve(__dirname, "assets/share.png"), to: "assets" },
87+
],
88+
}),
7689
],
7790
output: {
7891
filename: "[name].[hash].js",

0 commit comments

Comments
 (0)