UNPKG

vanilla-validation

Version:

Vanilla JavaScript validation rules

58 lines (54 loc) 1.13 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/ }, { test: /\.vue$/, loader: 'vue' } ] }, 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 } }), ];