2019-10-22 18:08:43 +02:00
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const include = path.resolve(__dirname, './src/scripts');
|
|
|
|
const exclude = /node_modules/;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {import('webpack').Configuration}
|
|
|
|
*/
|
|
|
|
module.exports = {
|
|
|
|
entry: ['./src/scripts/choices'],
|
|
|
|
output: {
|
|
|
|
library: 'Choices',
|
2019-10-24 19:21:40 +02:00
|
|
|
libraryTarget: 'window',
|
2019-10-22 18:08:43 +02:00
|
|
|
libraryExport: 'default',
|
2019-10-24 19:21:40 +02:00
|
|
|
globalObject: 'window',
|
2019-10-22 18:08:43 +02:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
enforce: 'pre',
|
|
|
|
loader: 'eslint-loader',
|
|
|
|
test: /\.js?$/,
|
|
|
|
include,
|
|
|
|
exclude,
|
|
|
|
options: {
|
|
|
|
quiet: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: 'babel-loader',
|
|
|
|
test: /\.js?$/,
|
|
|
|
include,
|
|
|
|
exclude,
|
|
|
|
options: {
|
|
|
|
babelrc: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
};
|