-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use prod webpack base config with overrides (#23)
- Loading branch information
Showing
2 changed files
with
33 additions
and
11 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |