diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..4943080 --- /dev/null +++ b/.babelrc @@ -0,0 +1,15 @@ +{ + presets: [ + [ + "@babel/preset-env", + { + modules: false, + targets: { + browsers: ["IE 11", "> 5%"] + }, + useBuiltIns: "usage", + corejs: "3" + } + ] + ] +} \ No newline at end of file diff --git a/config/vinlottis.config.js b/config/vinlottis.config.js index 38e4010..1f62ca7 100644 --- a/config/vinlottis.config.js +++ b/config/vinlottis.config.js @@ -5,7 +5,7 @@ const helpers = require("./helpers"); const VinlottisConfig = { entry: { - vinlottis: ["@babel/polyfill", helpers.root("src", "vinlottis-init")] + vinlottis: helpers.root("src", "vinlottis-init") }, optimization: { minimizer: [ diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index ca13cfb..4b7358c 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -41,7 +41,7 @@ let webpackConfig = merge(commonConfig(true), { webpackConfig = merge(webpackConfig, { entry: { - main: ["@babel/polyfill", helpers.root("src", "vinlottis-init")] + main: helpers.root("src", "vinlottis-init") }, plugins: [ new HtmlPlugin({ diff --git a/package.json b/package.json index e6e0d46..631688b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "author": "", "license": "ISC", "dependencies": { - "@babel/polyfill": "~7.2", "@zxing/library": "^0.15.2", "canvas-confetti": "^1.2.0", "chart.js": "^2.9.3", @@ -39,15 +38,16 @@ "web-push": "^3.4.3" }, "devDependencies": { - "@babel/core": "~7.2", + "@babel/core": "~7.12", "@babel/plugin-proposal-class-properties": "~7.3", "@babel/plugin-proposal-decorators": "~7.3", "@babel/plugin-proposal-json-strings": "~7.2", "@babel/plugin-syntax-dynamic-import": "~7.2", "@babel/plugin-syntax-import-meta": "~7.2", - "@babel/preset-env": "~7.3", + "@babel/preset-env": "~7.12", "babel-loader": "~8.0", "compression-webpack-plugin": "^3.1.0", + "core-js": "3", "cross-env": "^6.0.3", "css-loader": "^3.2.0", "file-loader": "^4.2.0", diff --git a/src/vinlottis-init.js b/src/vinlottis-init.js index f362976..f5e151c 100644 --- a/src/vinlottis-init.js +++ b/src/vinlottis-init.js @@ -4,6 +4,8 @@ import { routes } from "@/router.js"; import Vinlottis from "@/Vinlottis"; import VueAnalytics from "vue-analytics"; +import "core-js/stable"; // babel polyfill + Vue.use(VueRouter); Vue.use(VueAnalytics, { id: "UA-156846886-1"