From 3fa40d24b9d0ea7b3b139d05d6bc809f1750cf69 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Thu, 3 Oct 2019 13:30:55 +0200
Subject: [PATCH] Rename main entry point to the package name

---
 packages/auth/assets/index.html | 2 +-
 packages/auth/package.json      | 2 +-
 packages/auth/rollup.config.js  | 3 ++-
 packages/auth/src/index.js      | 1 -
 4 files changed, 4 insertions(+), 4 deletions(-)
 delete mode 100644 packages/auth/src/index.js

diff --git a/packages/auth/assets/index.html b/packages/auth/assets/index.html
index 83305f4f..0829f17a 100644
--- a/packages/auth/assets/index.html
+++ b/packages/auth/assets/index.html
@@ -2,7 +2,7 @@
 <html>
 <head>
     <meta charset="UTF-8">
-    <script type="module" id="vpu-auth-src" src="bundle.js"></script>
+    <script type="module" id="vpu-auth-src" src="vpu-auth.js"></script>
 </head>
 
 <body>
diff --git a/packages/auth/package.json b/packages/auth/package.json
index d128185a..ece4d547 100644
--- a/packages/auth/package.json
+++ b/packages/auth/package.json
@@ -1,7 +1,7 @@
 {
   "name": "vpu-auth",
   "version": "1.0.0",
-  "main": "src/index.js",
+  "main": "src/vpu-auth.js",
   "devDependencies": {
     "chai": "^4.2.0",
     "i18next-scanner": "^2.10.2",
diff --git a/packages/auth/rollup.config.js b/packages/auth/rollup.config.js
index 7bc07c81..f2072c54 100644
--- a/packages/auth/rollup.config.js
+++ b/packages/auth/rollup.config.js
@@ -10,13 +10,14 @@ import url from "rollup-plugin-url";
 import consts from 'rollup-plugin-consts';
 import del from 'rollup-plugin-delete';
 
+const pkg = require('./package.json');
 const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
 console.log("build: " + build);
 
 export default {
     input: (build != 'test') ? 'src/demo.js' : 'test/**/*.js',
     output: {
-        file: 'dist/bundle.js',
+        file: 'dist/' + pkg.name + '.js',
         format: 'esm'
     },
     plugins: [
diff --git a/packages/auth/src/index.js b/packages/auth/src/index.js
deleted file mode 100644
index 64b5752d..00000000
--- a/packages/auth/src/index.js
+++ /dev/null
@@ -1 +0,0 @@
-import './vpu-auth';
-- 
GitLab