add babel

This commit is contained in:
Daniel Waxweiler 2022-01-09 12:35:26 +01:00
parent 4270145a55
commit ec12889815
4 changed files with 3707 additions and 153 deletions

3842
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,10 @@
"object-hash": "^2.2.0"
},
"devDependencies": {
"@babel/core": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"ava": "^4.0.1",
"babel-loader": "^8.2.3",
"c8": "^7.11.0",
"copy-webpack-plugin": "^10.2.0",
"eslint": "^8.6.0",

View File

@ -1,5 +1,6 @@
### [Unreleased]
#### Added
- Add support for older browsers using babel
#### Changed
- Confirm compatibility with WordPress 5.9
- Update dependencies

View File

@ -11,6 +11,20 @@ module.exports = {
filename: 'events-loader.js',
path: path.resolve(__dirname, 'build/' + '/front'),
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { targets: 'defaults' }]],
},
},
},
],
},
plugins: [
new CopyPlugin({
patterns: [