From e9989190972fcd149a8a95c2c6143df742ac9490 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 23 Aug 2021 10:02:39 +0200 Subject: [PATCH] web: fix build not working Signed-off-by: Jens Langhammer --- web/rollup.config.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/web/rollup.config.js b/web/rollup.config.js index 19f124b0c..888953df2 100644 --- a/web/rollup.config.js +++ b/web/rollup.config.js @@ -6,6 +6,7 @@ import cssimport from "rollup-plugin-cssimport"; import copy from "rollup-plugin-copy"; import babel from "@rollup/plugin-babel"; import replace from "@rollup/plugin-replace"; +import * as authentik from "@goauthentik/api"; const extensions = [".js", ".jsx", ".ts", ".tsx"]; @@ -99,7 +100,11 @@ export default [ plugins: [ cssimport(), resolve({ extensions, browser: true }), - commonjs(), + // Because the API Client uses star exports from typescript, we have to explicitly tell rollup + // Which classes can be imported + commonjs({ + namedExports: { '@goauthentik/api': Object.keys(authentik) }, + }), babel({ extensions, babelHelpers: "runtime", @@ -131,7 +136,11 @@ export default [ plugins: [ cssimport(), resolve({ extensions, browser: true }), - commonjs(), + // Because the API Client uses star exports from typescript, we have to explicitly tell rollup + // Which classes can be imported + commonjs({ + namedExports: { '@goauthentik/api': Object.keys(authentik) }, + }), babel({ extensions, babelHelpers: "runtime",