Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz committed Jun 3, 2023
1 parent 2a78f67 commit d987b08
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 28 deletions.
7 changes: 6 additions & 1 deletion config/data/paragonUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ function getParagonCacheGroups(paragonThemeCss) {

/**
* @param {ParagonThemeCss} paragonThemeCss The Paragon theme CSS metadata.
* @returns {Object.<string, string>} The entry points for the Paragon theme CSS.
* @returns {Object.<string, string>} The entry points for the Paragon theme CSS. Example: ```
* {
* "paragon.theme.core": "/path/to/node_modules/@edx/paragon/dist/core.min.css",
* "paragon.theme.variants.light": "/path/to/node_modules/@edx/paragon/dist/light.min.css"
* }
* ```
*/
function getParagonEntryPoints(paragonThemeCss) {
const entryPoints = {};
Expand Down
7 changes: 7 additions & 0 deletions config/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ const paragonThemeCss = getParagonThemeCss(process.cwd());
module.exports = {
entry: {
app: path.resolve(process.cwd(), './src/index'),
/**
* The entry points for the Paragon theme CSS. Example: ```
* {
* "paragon.theme.core": "/path/to/node_modules/@edx/paragon/dist/core.min.css",
* "paragon.theme.variants.light": "/path/to/node_modules/@edx/paragon/dist/light.min.css"
* }
*/
...getParagonEntryPoints(paragonThemeCss),
},
output: {
Expand Down
5 changes: 5 additions & 0 deletions config/webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const path = require('path');
const PostCssAutoprefixerPlugin = require('autoprefixer');
const PostCssRTLCSS = require('postcss-rtlcss');
const PostCssCustomMediaCSS = require('postcss-custom-media');
const CompressionPlugin = require('compression-webpack-plugin');

// Reduce CSS file size by ~70%
const purgecss = require('@fullhuman/postcss-purgecss');
Expand Down Expand Up @@ -210,6 +211,10 @@ module.exports = merge(commonConfig, {
path: path.resolve(process.cwd(), '.env'),
systemvars: true,
}),
new CompressionPlugin({
algorithm: 'gzip',
test: /.js$|.css$/,
}),
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false,
Expand Down
70 changes: 44 additions & 26 deletions example/package-lock.json

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

2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@edx/paragon": "21.0.0-alpha.30",
"@edx/paragon": "^21.0.0-alpha.31",
"react": "16.14.0",
"react-dom": "16.14.0"
},
Expand Down
69 changes: 69 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 @@ -45,6 +45,7 @@
"babel-plugin-transform-imports": "2.0.0",
"babel-polyfill": "6.26.0",
"clean-webpack-plugin": "4.0.0",
"compression-webpack-plugin": "^10.0.0",
"css-loader": "5.2.7",
"cssnano": "6.0.1",
"dotenv": "8.6.0",
Expand Down

0 comments on commit d987b08

Please sign in to comment.