This repo is an extend with angularhttps://www.npmjs.com/package/@angular-devkit/build-angular, provided the custom plugins.
consider publish into npm
-
download and build
- git pull <> dir-name
- npm install
- npm run build
-
config in angular project
- add to the dev dependency: "@xkx/custom-esbuild": "file:
../../../web-dev/custom_esbuild", replace../../../web-dev/custom_esbuildinto your last step dir-name - npm install (your angular project)
- change the angular.json
... "architect": { "build": { "builder": "@xkx/custom-esbuild:esbuild", ... "options": { ... "customEsbuildConfig": "./esbuild/esbuildConfig.js", (path to your customer config, currently hard code for vite-serve ) ... }
- config the esbuild plugin file
const wsdlPlugin = require('./plugins/xml.plugin'); const ttfLoaderPlugin = require('./plugins/ttf.plugin'); const getPlugins = async () => { const plugins = [] const svgPluginModule = await import('esbuild-plugin-svg'); if (svgPluginModule.default) { plugins.push(svgPluginModule.default()) } const polyfillNodeModule = await import('esbuild-plugin-polyfill-node'); if (polyfillNodeModule) { plugins.push(polyfillNodeModule.polyfillNode({ fs: true })) } plugins.push(wsdlPlugin()) plugins.push(ttfLoaderPlugin()) return plugins } module.exports = { getPlugins: getPlugins }
- add to the dev dependency: "@xkx/custom-esbuild": "file:
-
Run ng build