I have a minified, bundled JS file using Webpack. The file is working on modern browsers, but when I get to Safari 12.1.2, it causes this error:
Unexpected token '='. Expected an opening '(' before a method's parameter list.
Here's the minified bit of code, where the error is being thrown at line 1:0
(()=>{"use strict";class e{constructor(){this.metabox=document.querySelector("#polarity-metabox") ... // Code continues
I'm new to Webpack, and this is my first project using it - is there anything in Webpack's settings I can use to fix it? How can I fix this error?
const path = require("path");
module.exports = {
entry: {
theme: __dirname + "/assets/js/modules-theme/index.js",
product: __dirname + "/assets/js/modules-product/index.js",
},
output: {
filename: "[name].bundled.js",
path: path.resolve(__dirname, "assets/js/"),
},
mode: "production",
watch: true,
};