Contribution Guide
The bundle has two independent frontend builds. Neither touches the output of the other.
| Build | Source | Tool | Output |
|---|---|---|---|
Legacy explorer (explorer, loader entries) | assets/js | webpack encore | src/Resources/public/build (committed) |
| Explorer app on the Studio stack | assets/explorer | rsbuild | src/Resources/public/explorer (committed) |
The Studio module in assets/studio has its own rsbuild build and is not covered here.
Frontend Builds: legacy explorer
All legacy frontend assets are build with webpack encore. The most recent production build is
added to the repository in src/Resources/public/build folder.
To build frontend assets
- install webpack encore to your project
- add following content to your
package.json
{
"name": "demo-project",
"version": "1.0.0",
"description": "This skeleton should be used by experienced Pimcore developers for starting a new project from the ground up. If you are new to Pimcore, it's better to start with our demo package, listed below 😉",
"main": "index.js",
"scripts": {
"encore": "encore",
"dev": "npx encore dev --watch",
"production": "npx encore production"
},
"dependencies": {
"statitics-explorer": "file:<RELATIVE_PATH_TO_STATISTICS_EXPLORER_BUNDLE>"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/preset-react": "^7.10.4",
"@symfony/webpack-encore": "^0.31.0",
"webpack-notifier": "^1.8.0"
}
}
- for development use the following command:
npm run dev - for creating production build use the following command:
npm run production
Frontend Builds: explorer app (assets/explorer)
A TypeScript app (React 18, rsbuild, antd through the Portal UI Kit) that builds beside assets/js. The legacy
entries stay until the next major release. It builds the explorer and loader entries
(src/explorer/index.tsx, src/loader/index.tsx) that replace them.
The app depends on @pimcore/portal-ui-kit, which is delivered by Composer as pimcore/portal-ui-kit (required in
composer.json) and linked by path, like portal_engine/assets/portal does:
"@pimcore/portal-ui-kit": "file:../../vendor/pimcore/portal-ui-kit/frontend/portal-ui-kit"
- run
composer installin the bundle first, so thatvendor/pimcore/portal-ui-kitexists cd assets/explorer && npm installnpm run buildcreates the production bundle insrc/Resources/public/explorer, which installs serve as/bundles/pimcorestatisticsexplorer/explorer; commit it with every change to the app (a test compares it with a fresh build)npm run devstarts the rsbuild dev servernpm run check-typesruns the type checknpm testruns the tests (vitest)