From 45589cf5af4e79ba40115c641ef9767f65ffe68b Mon Sep 17 00:00:00 2001 From: Cornelius Wichering Date: Fri, 18 May 2018 19:05:50 +0200 Subject: [PATCH] Workaround for firebase-ui nr 392 https://github.com/firebase/firebaseui-web/issues/392 --- package-lock.json | 10 ++++++++++ package.json | 1 + vue.config.js | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 vue.config.js diff --git a/package-lock.json b/package-lock.json index 87a2542..a4e355d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14630,6 +14630,16 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, + "string-replace-loader": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-replace-loader/-/string-replace-loader-2.1.1.tgz", + "integrity": "sha512-0Nvw1LDclF45AFNuYPcD2Jvkv0mwb/dQSnJZMvhqGrT+zzmrpG3OJFD600qfQfNUd5aqfp7fCm2mQMfF7zLbyQ==", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "schema-utils": "0.4.5" + } + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", diff --git a/package.json b/package.json index 9018e16..45fc2e8 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "lint-staged": "^6.0.0", "node-sass": "^4.9.0", "sass-loader": "^6.0.6", + "string-replace-loader": "^2.1.1", "vue-template-compiler": "^2.5.13" }, "browserslist": [ diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..2127b69 --- /dev/null +++ b/vue.config.js @@ -0,0 +1,22 @@ +const path = require("path"); + +// Haha, this is just a bad joke about the current state of js development. +// see https://github.com/firebase/firebaseui-web/issues/392 + +module.exports = { + configureWebpack: { + module: { + rules: [ + { + test: /npm\.js$/, + loader: "string-replace-loader", + include: path.resolve("node_modules/firebaseui/dist"), + options: { + search: "require('firebase/app');", + replace: "require('firebase/app').default;" + } + } + ] + } + } +};