CodiceFiscaleJS/webpack.config.js
Luca Vandro 6db085e308 Fixed new Date => new Date(Date.UTC(....))
Improved test
Dependency clean up
2019-03-28 20:02:17 +01:00

45 lines
913 B
JavaScript
Executable File

const path = require('path')
const webpack = require('webpack')
const createVariants = require('parallel-webpack').createVariants
function createConfig (options) {
return {
mode: "production",
entry: {
'codice.fiscale': './src/codice-fiscale.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'codice.fiscale.' + options.target + '.js',
library: 'CodiceFiscale',
libraryTarget: options.target
},
module: {
rules: [
{
test: /\.json$/,
loader: 'json-loader'
}, {
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader'
}
}
]
},
optimization: {
minimize: true
}
}
}
module.exports = createVariants({
target: [
'var',
'commonjs2',
'umd',
'amd'
]
}, createConfig)