Choices/webpack.config.base.js
Konstantin Vyatkin bef6743c3b set window target for minified build (#685)
* set `globalObject` option

* commit builded assets

* set window target for minified build
2019-10-24 18:21:40 +01:00

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,
},
},
],
},
};