json-logic-js/webpack.config.js

42 lines
803 B
JavaScript

const webpack = require('webpack');
const path = require('path');
/*
* We've enabled UglifyJSPlugin for you! This minifies your app
* in order to load faster and run less javascript.
*
* https://github.com/webpack-contrib/uglifyjs-webpack-plugin
*
*/
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: './src/index',
output: {
filename: 'json-logic.js',
path: path.resolve(__dirname, 'dist'),
library: 'jsonLogic',
libraryTarget: 'umd',
umdNamedDefine: true,
globalObject: 'typeof self !== \'undefined\' ? self : this'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['env']
}
}
]
},
plugins: [new UglifyJSPlugin()]
};