UNPKG

vanilla-validation

Version:

Vanilla JavaScript validation rules

54 lines (50 loc) 1.06 kB
const webpack = require('webpack'); const merge = require('webpack-merge'); const path = require('path'); var config = { output: { path: path.resolve(__dirname + '/dist/'), }, module: { loaders: [ { test: /\.js$/, loader: 'babel', include: __dirname, exclude: /node_modules/ } ] }, externals: { moment: 'moment' }, plugins: [ new webpack.optimize.UglifyJsPlugin( { minimize : true, sourceMap : false, mangle: true, compress: { warnings: false } } ) ] }; module.exports = [ merge(config, { entry: path.resolve(__dirname + '/src/plugin.js'), output: { filename: 'vanilla-validation.min.js', libraryTarget: 'window', library: 'VanillaValidation', } }), merge(config, { entry: path.resolve(__dirname + '/src/utilities/form-validation.js'), output: { filename: 'vanilla-validation.js', libraryTarget: 'umd', library: 'VanillaValidation', umdNamedDefine: true } }), ];