diff options
author | 2020-10-12 14:19:44 +0100 | |
---|---|---|
committer | 2020-10-12 14:19:44 +0100 | |
commit | ce25e0c4fe092dd29e132c21b20498758d2398bc (patch) | |
tree | 4453bc5e79d94b4642b07ea6bb1286f9c2be1d2d /webpack.config.js | |
parent | Correct 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.js | 12 |
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' }) ] } |