mirror of
https://github.com/danog/CodiceFiscaleJS.git
synced 2024-11-30 04:29:11 +01:00
6db085e308
Improved test Dependency clean up
45 lines
913 B
JavaScript
Executable File
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)
|