Sometimes you may want to debug a problem related to one of TEI Publisher’s web components - or you may want to improve a component and test it directly within the TEI Publisher application context.
In order to debug or test you need to have a local version of TEI Publisher’s web component library:
npm start command should look similar to the following:
es-dev-server started on http://localhost:8000 Serving files from '/Users/wolfgang/Source/apps/tei-publisher/pb-components'. Opening browser on '/' Using history API fallback, redirecting route requests to '/api.html' Using auto compatibility mode, transforming code on older browsers based on user agent.
Search for the two variables:
$config:webcomponents-cdn. Set the first to
dev instead of specifying a version. The second needs to point to the local server you started with npm above:
declare variable $config:webcomponents := "dev"; declare variable $config:webcomponents-cdn := "http://localhost:8000";
You can confirm this by opening the ~developer tools~ in your browser, switching to the ~network~ tab and checking the
.js files being loaded: instead of a few large files, you should now see many small files being loaded, e.g.
src/pb-components-bundle.js and many more.
You can also make changes to any of the source files in your clone of
tei-publisher-components and - while
npm start is running - changes will apply whenever you reload the page.