From 571873cab03a660d8f0b85808e4d16208bc31dc9 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Wed, 27 Mar 2024 02:09:30 +0100 Subject: [PATCH] add "--failAfterWarnings" to the rollup command, since after the types are correct. we only want it to compile, if no errors / warnings are generated by rollup - silence gjs external modules warnings --- package.json | 2 +- rollup.config.mjs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 689b1d59..5cf268e0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "build": "yarn run build:ts && yarn run gen:locale && yarn run build:extension", "gen:locale": "yarn run ts-node scripts/generateLocale.ts", - "build:ts": "yarn run clean:ts && rollup -c && sed -i '/setTimeout/d' dist/thirdparty/prismjs.js && sed -i 's/var\\ /let\\ /g' dist/{extension,prefs}.js", + "build:ts": "yarn run clean:ts && rollup -c --failAfterWarnings && sed -i '/setTimeout/d' dist/thirdparty/prismjs.js && sed -i 's/var\\ /let\\ /g' dist/{extension,prefs}.js", "clean:ts": "rm -rf ./dist", "build:extension": "yarn run build:schema", "build:schema": "yarn run clean:schema && glib-compile-schemas ./resources/schemas --targetdir=./dist/schemas/", diff --git a/rollup.config.mjs b/rollup.config.mjs index ea8c1866..360a0ebb 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -97,6 +97,8 @@ const thirdParty = [ 'highlight.js/lib/languages/yaml', ]; +const gjsModules = [...Object.keys(importsGeneral), ...Object.keys(importsPrefs)]; + const GlobalEntries = {}; const thirdPartyBuild = thirdParty.map((pkg) => { @@ -143,7 +145,7 @@ const builds = [ constBindings: true, }, }, - external: thirdParty, + external: [...thirdParty, ...gjsModules], plugins: [ commonjs(), nodeResolve({ @@ -184,7 +186,7 @@ const builds = [ treeshake: { moduleSideEffects: 'no-external', }, - external: thirdParty, + external: [...thirdParty, ...gjsModules], plugins: [ commonjs(), nodeResolve({