aboutsummaryrefslogtreecommitdiffstats
path: root/webpack.config.js
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2020-10-12 14:19:44 +0100
committerGravatar Joe Banks <[email protected]>2020-10-12 14:19:44 +0100
commitce25e0c4fe092dd29e132c21b20498758d2398bc (patch)
tree4453bc5e79d94b4642b07ea6bb1286f9c2be1d2d /webpack.config.js
parentCorrect build path and add hash to generated filenames (diff)
Add webpack plugin for copying static files
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/webpack.config.js b/webpack.config.js
index 0fe45da..60a77ba 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,5 +1,6 @@
const path = require("path")
const HtmlWebpackPlugin = require("html-webpack-plugin");
+const CopyPlugin = require('copy-webpack-plugin');
const webpack = require("webpack")
module.exports = (env) => {
@@ -71,9 +72,10 @@ module.exports = (env) => {
historyApiFallback: true,
},
plugins: [
- new HtmlWebpackPlugin({
- inject: true,
- template: 'public/index.html'
+ new CopyPlugin({
+ patterns: [
+ { from: 'public', to: 'build' },
+ ],
}),
new webpack.EnvironmentPlugin({
NODE_ENV: "production",
@@ -81,6 +83,10 @@ module.exports = (env) => {
REACT_APP_SENTRY_DSN: "development",
REACT_APP_BRANCH: "development",
REACT_APP_OAUTH2_CLIENT_ID: "0"
+ }),
+ new HtmlWebpackPlugin({
+ inject: true,
+ template: 'public/index.html'
})
]
}