mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-27 01:40:26 +02:00
bef6743c3b
* set `globalObject` option * commit builded assets * set window target for minified build
41 lines
743 B
JavaScript
41 lines
743 B
JavaScript
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',
|
|
libraryTarget: 'window',
|
|
libraryExport: 'default',
|
|
globalObject: 'window',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
enforce: 'pre',
|
|
loader: 'eslint-loader',
|
|
test: /\.js?$/,
|
|
include,
|
|
exclude,
|
|
options: {
|
|
quiet: true,
|
|
},
|
|
},
|
|
{
|
|
loader: 'babel-loader',
|
|
test: /\.js?$/,
|
|
include,
|
|
exclude,
|
|
options: {
|
|
babelrc: true,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
};
|