Replace babel/polyfill w/ core-js v3.
Babel versions above 7.4 recommend using new core-js polyfill over deprecated babel/polyfill. Also updated babel/core and babel/preset-env. Added babelrc for defined config of corejs version & targeted browsers.
This commit is contained in:
15
.babelrc
Normal file
15
.babelrc
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
"@babel/preset-env",
|
||||||
|
{
|
||||||
|
modules: false,
|
||||||
|
targets: {
|
||||||
|
browsers: ["IE 11", "> 5%"]
|
||||||
|
},
|
||||||
|
useBuiltIns: "usage",
|
||||||
|
corejs: "3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ const helpers = require("./helpers");
|
|||||||
|
|
||||||
const VinlottisConfig = {
|
const VinlottisConfig = {
|
||||||
entry: {
|
entry: {
|
||||||
vinlottis: ["@babel/polyfill", helpers.root("src", "vinlottis-init")]
|
vinlottis: helpers.root("src", "vinlottis-init")
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
minimizer: [
|
minimizer: [
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ let webpackConfig = merge(commonConfig(true), {
|
|||||||
|
|
||||||
webpackConfig = merge(webpackConfig, {
|
webpackConfig = merge(webpackConfig, {
|
||||||
entry: {
|
entry: {
|
||||||
main: ["@babel/polyfill", helpers.root("src", "vinlottis-init")]
|
main: helpers.root("src", "vinlottis-init")
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new HtmlPlugin({
|
new HtmlPlugin({
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/polyfill": "~7.2",
|
|
||||||
"@zxing/library": "^0.15.2",
|
"@zxing/library": "^0.15.2",
|
||||||
"canvas-confetti": "^1.2.0",
|
"canvas-confetti": "^1.2.0",
|
||||||
"chart.js": "^2.9.3",
|
"chart.js": "^2.9.3",
|
||||||
@@ -39,15 +38,16 @@
|
|||||||
"web-push": "^3.4.3"
|
"web-push": "^3.4.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "~7.2",
|
"@babel/core": "~7.12",
|
||||||
"@babel/plugin-proposal-class-properties": "~7.3",
|
"@babel/plugin-proposal-class-properties": "~7.3",
|
||||||
"@babel/plugin-proposal-decorators": "~7.3",
|
"@babel/plugin-proposal-decorators": "~7.3",
|
||||||
"@babel/plugin-proposal-json-strings": "~7.2",
|
"@babel/plugin-proposal-json-strings": "~7.2",
|
||||||
"@babel/plugin-syntax-dynamic-import": "~7.2",
|
"@babel/plugin-syntax-dynamic-import": "~7.2",
|
||||||
"@babel/plugin-syntax-import-meta": "~7.2",
|
"@babel/plugin-syntax-import-meta": "~7.2",
|
||||||
"@babel/preset-env": "~7.3",
|
"@babel/preset-env": "~7.12",
|
||||||
"babel-loader": "~8.0",
|
"babel-loader": "~8.0",
|
||||||
"compression-webpack-plugin": "^3.1.0",
|
"compression-webpack-plugin": "^3.1.0",
|
||||||
|
"core-js": "3",
|
||||||
"cross-env": "^6.0.3",
|
"cross-env": "^6.0.3",
|
||||||
"css-loader": "^3.2.0",
|
"css-loader": "^3.2.0",
|
||||||
"file-loader": "^4.2.0",
|
"file-loader": "^4.2.0",
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import { routes } from "@/router.js";
|
|||||||
import Vinlottis from "@/Vinlottis";
|
import Vinlottis from "@/Vinlottis";
|
||||||
import VueAnalytics from "vue-analytics";
|
import VueAnalytics from "vue-analytics";
|
||||||
|
|
||||||
|
import "core-js/stable"; // babel polyfill
|
||||||
|
|
||||||
Vue.use(VueRouter);
|
Vue.use(VueRouter);
|
||||||
Vue.use(VueAnalytics, {
|
Vue.use(VueAnalytics, {
|
||||||
id: "UA-156846886-1"
|
id: "UA-156846886-1"
|
||||||
|
|||||||
Reference in New Issue
Block a user