Skip to content

Commit

Permalink
add "--failAfterWarnings" to the rollup command, since after the type…
Browse files Browse the repository at this point in the history
…s are correct. we only want it to compile, if no errors / warnings are generated by rollup

- silence gjs external modules warnings
  • Loading branch information
Totto16 committed Mar 27, 2024
1 parent 5c90b72 commit 571873c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down
6 changes: 4 additions & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -143,7 +145,7 @@ const builds = [
constBindings: true,
},
},
external: thirdParty,
external: [...thirdParty, ...gjsModules],
plugins: [
commonjs(),
nodeResolve({
Expand Down Expand Up @@ -184,7 +186,7 @@ const builds = [
treeshake: {
moduleSideEffects: 'no-external',
},
external: thirdParty,
external: [...thirdParty, ...gjsModules],
plugins: [
commonjs(),
nodeResolve({
Expand Down

0 comments on commit 571873c

Please sign in to comment.