ui/3x, package pixwel-ui) is built with Webpack 5. It replaces the Gulp pipeline the legacy AngularJS UI used.
Work in
ui/3x with pnpm — its engines field says npm, but npm install fails there. Install dependencies with pnpm install.Common commands
Run these fromui/3x:
| Command | What it does |
|---|---|
pnpm start | Start the Webpack dev server on port 9000. |
pnpm start:dev | Dev server with DEV=true, opening a browser. |
pnpm build:ci | Production build (CI=true webpack build). |
pnpm serve:ci | Serve the built dist/ on port 9000. |
pnpm lint | ESLint + Stylelint over the source. |
pnpm test | Jest with coverage — see UI testing. |
pnpm storybook | Storybook on port 6006. |
https://development.pixwel.com:9000.
How the build is configured
The build is defined inui/3x/webpack.config.js:
- Entry —
index.js. - Output — hashed bundles (
js/[name].[contenthash].js) withpublicPath: '/', written to thedist/directory. - Dev server — runs on port 9000 with
historyApiFallbackfor client-side routing and aproxyto the API. - Styles — SCSS compiled with
sass-loader. - JavaScript — transpiled with Babel.
HtmlWebpackPlugin— generatesindex.htmlfrom a template.CopyWebpackPlugin— copies static assets into the build.ProvidePlugin/DefinePlugin— inject globals andprocess.env.NODE_ENV.@sentry/webpack-plugin— uploads source maps to Sentry for error tracking.
mode is development for the dev server and production for build:ci.