Commit graph

13 commits

Author SHA1 Message Date
regexowl
716c0bf361 fec.config: Exclude pkg directory during build time
After running `make cockpit/devel`, the generated files do not pass `npm run build`, outputing failures and making dev console and output of `npm run build` cluttered with errors.

This excludes `/pkg` folder during build time, removing the errors.
2025-03-28 16:42:47 +01:00
Adonis Puente
60fc68310d feat(RHINENG-15883): Add image-builder to new sentry flow 2025-03-17 13:02:23 +01:00
Michal Gold
7d2ca8f1ee fec: enable useFileHash
this commmit enable useFileHash in fec.config.js -
when set it to true Webpack will append a hash (a unique identifier) to the filename based on its content.
This helps prevent the browser from using an outdated cached version of a file when its content has changed.
2025-02-04 12:39:09 +01:00
Gianluca Zuccarelli
ed8254f962 test/mocks: add cockpit os-release
Add a stub function for the `os-release` package from cockpit.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
2b82fa3c4b tsconfig: cockpit plumbing
It was necessary to do a bit of plumbing to get typescript, webpack &
vitest all happy. To do this we had had to create a separate tsconfig
for the on-prem version and the service frontend.

We override the module resolution for both config files. For on-prem we
check modules in `pkg/lib` and for the service we resolve the modules to
stub functions of the `cockpit` & `cockpit/fsinfo` modules. This was so
typescript and webpack would not complain.

For on-prem we had to intruct webpack to resolve modules from both
`node_modules` and `pkg/lib`. While for the service we set the
resulotion for the two modules to false, which means they won't get
bundled with the service.

Lastly, we needed to set some aliases in the vitest config so that
vitest could resolve the `cockpit` & `cockpit/fsinfo` modules.

Using the cjs `require` keyword to import cockpit would have worked to
make typescript and webpack compile since these imports are not
statically analysed like the `import` keyword is. However, this approach
broke the tests as `require` imports are not supported in vitest.
2024-12-21 08:19:15 -06:00
Sanne Raymaekers
196f52b821 fec.config.js: use webpack plugin to inject sentry debug ids
The module metadata, which is only available in the webpack plugin, is
needed for correct routing.
2024-12-11 16:58:58 +01:00
Sanne Raymaekers
a2b8883350 fec.config: move sentry's moduleMetadata out of _experiments 2024-11-18 13:16:48 +01:00
Sanne Raymaekers
dc613de3cb Revert "fec.config: prefix paths"
I misunderstood, this is for legacy sourcemaps only, the new method uses
debug IDs which are embedded and don't rely on url paths to resolve the
sources.

This reverts commit 2410143ba0.
2024-11-18 13:16:48 +01:00
Sanne Raymaekers
2410143ba0 fec.config: prefix paths
The paths of each artefact needs to be prefixed to reflect where the
static resources are hosted on consoledot (which is under
/apps/image-builder).
2024-11-18 09:36:10 +01:00
Sanne Raymaekers
4b16cf3c98 fec.config: fix typo in sentry plugin 2024-11-15 11:31:30 +01:00
Sanne Raymaekers
d20ae705fc fec: add sentry plugin
This will enable unminified stacktraces in sentry.
2024-11-15 10:09:38 +01:00
Florian Schüller
7f1b8b7215 fec.config.js: preparation to get process.env.MSW working 2024-08-19 19:33:44 +02:00
regexowl
ba29232c91 config: Replace webpack configs with FEC config
This migrates from previously used webpack configs to one fec.config.js.

This will allow us to bump `frontend-components-config` dependency to version 6.x and stay supported in the future.
2024-07-19 16:55:25 +02:00
Renamed from config/dev.webpack.config.js (Browse further)