Skip to content

Commit

Permalink
feat: copy static to dist folder for prod (openedx#1057)
Browse files Browse the repository at this point in the history
* feat: copy static to dist folder for prod

* chore: update webpack.prod.config.js

Co-authored-by: Ben Warzeski <[email protected]>

Co-authored-by: Ben Warzeski <[email protected]>
  • Loading branch information
ztraboo and muselesscreator committed Oct 9, 2024
1 parent b727879 commit 96cd5c7
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 0 deletions.
125 changes: 125 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"@testing-library/user-event": "13.4.1",
"axios-mock-adapter": "1.20.0",
"codecov": "3.8.3",
"copy-webpack-plugin": "^11.0.0",
"es-check": "6.0.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"glob": "7.2.0",
Expand Down
14 changes: 14 additions & 0 deletions webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
const path = require('path');
const { getBaseConfig } = require('@edx/frontend-build');
const CopyPlugin = require('copy-webpack-plugin');

const config = getBaseConfig('webpack-prod');

config.plugins.push(
new CopyPlugin({
patterns: [
{
from: path.resolve(__dirname, './public/static'),
to: path.resolve(__dirname, './dist/static'),
},
],
}),
);

// Filter plugins in the preset config that we don't want
function filterPlugins(plugins) {
const pluginsToRemove = [
Expand All @@ -16,3 +29,4 @@ function filterPlugins(plugins) {
config.plugins = filterPlugins(config.plugins);

module.exports = config;

Check failure on line 32 in webpack.prod.config.js

View workflow job for this annotation

GitHub Actions / build (12)

Too many blank lines at the end of file. Max of 0 allowed

Check failure on line 32 in webpack.prod.config.js

View workflow job for this annotation

GitHub Actions / build (12)

Too many blank lines at the end of file. Max of 0 allowed

0 comments on commit 96cd5c7

Please sign in to comment.