---
# System prepended metadata

title: ESM server builds using 3P builder

---

# ESM server builds using 3P builder

1. Add resolutions in `package.json` as the 3P builder does not yet support Angular 16.
```json 
"resolutions": {
  "@angular-devkit/build-angular": "^16.0.0-next.0"
},
```
3. yarn add @angular-builders/custom-webpack --dev 
4. Update `angular.json`.
```diff
"server": {
+  "builder": "@angular-devkit/build-angular:server",
-  "builder": "@angular-builders/custom-webpack:server",
  "options": {
+    "customWebpackConfig": {
+      "path": "./extra-webpack.config.mjs"
+    },
    "outputPath": "dist/test/server",
```

3. Create `extra-webpack.config.mjs`
```js
export default {
  output: {
    filename: "[name].mjs",
    chunkFilename: "[name].mjs",
    chunkFormat: "module",
    libraryTarget: "module",
  },
  experiments: {
    outputModule: true,
  },
  optimization: {
    splitChunks: {
      cacheGroups: {
        defaultVendors: false,
      },
    },
  },
};
```