Skip to content

Commit

Permalink
feat: use prod webpack base config with overrides (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
binodpant authored Nov 18, 2020
1 parent 8fa5c10 commit 726bd89
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
11 changes: 0 additions & 11 deletions public/index.html

This file was deleted.

33 changes: 33 additions & 0 deletions webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const { getBaseConfig } = require('@edx/frontend-build');

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

const config = {
...origConfig,
/* option overrides or extensions */
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
libraryTarget: 'umd',
globalObject: "typeof self !== 'undefined' ? self : this",
},
// Exclude react and any package that has it as a dependency from the bundle.
externals: {
react: 'react',
'@edx/frontend-platform/auth': '@edx/frontend-platform/auth',
},
resolve: {
extensions: ['.js', '.jsx'],
},
plugins: [
new UglifyJsPlugin({
sourceMap: true,
}),
],
optimization: {},
};

module.exports = config;

0 comments on commit 726bd89

Please sign in to comment.