Files
elasticsearch-js/webpack_config/lib.js
Spencer 7c1573fb07 Use standard and prettier (#10)
* switch from custom eslint config to standard + prettier

* fix new standard eslint violations

* add editorconfig file

* auto-fix all other violations

* update lint yarn script

* remove jshint comment
2019-07-09 13:24:13 -07:00

38 lines
732 B
JavaScript

const rel = require('path').resolve.bind(null, __dirname, '..');
function ignoreLoader(ignores) {
return {
loader: 'null-loader',
test(path) {
return ignores.some(ignore => path.includes(ignore));
},
};
}
function jsLoader() {
return {
test: /\.js$/,
include: rel('src'),
loader: 'babel-loader',
options: {
babelrc: false,
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: [
'last 2 versions',
'> 5%',
'Safari 7', // for PhantomJS support
],
},
},
],
],
},
};
}
module.exports = { ignoreLoader, jsLoader, rel };