UNPKG

effective-interest-rate

Version:

A library to calculate effective interest rate. Also know as XIRR or effective APR.

49 lines (43 loc) 1.05 kB
var webpack = require('webpack'); var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin; var env = process.env.WEBPACK_ENV; var path = require('path'); var appName = 'effective-interest'; var plugins = [], outputFile; if (env === 'build') { plugins.push(new UglifyJsPlugin({ minimize: true })); outputFile = appName + '.min.js'; } else { outputFile = appName + '.js'; } var config = { entry: __dirname + '/src/EffectiveInterestCalculator.js', devtool: 'source-map', output: { path: __dirname + '/lib', filename: outputFile, library: 'EffectiveInterestCalculator', libraryTarget: 'umd', umdNamedDefine: true }, module: { loaders: [ { test: /(\.jsx|\.js)$/, loader: 'babel', exclude: /(node_modules|bower_components)/ }, { test: /(\.jsx|\.js)$/, loader: "eslint-loader", exclude: /node_modules/ } ] }, resolve: { root: path.resolve('./src'), extensions: ['', '.js'] }, plugins: plugins }; module.exports = config;