onairos
Version:
The Onairos Library is a collection of functions that enable Applications to connect and communicate data with Onairos Identities via User Authorization. Integration for developers is designed to be seamless, simple and effective for all applications
62 lines (61 loc) • 1.38 kB
JavaScript
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
entry: path.resolve(__dirname, 'src', 'onairos.jsx'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'onairos.bundle.js',
libraryTarget: 'umd',
globalObject: 'this',
umdNamedDefine: true,
},
externals: {
react: {
commonjs: 'react',
commonjs2: 'react',
amd: 'React',
root: 'React'
},
'react-dom': {
commonjs: 'react-dom',
commonjs2: 'react-dom',
amd: 'ReactDOM',
root: 'ReactDOM'
}
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: {
dead_code: true,
},
mangle: true,
output: {
comments: false,
},
},
extractComments: false,
}),
],
},
devtool: process.env.NODE_ENV === 'production' ? false : 'source-map',
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
}
},
]
},
resolve: {
extensions: ['.js', '.jsx', '.mjs'],
},
};