Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xsip/ngx-ssr-code-remover
Post processor to remove SSR Code from bundles when served
https://github.com/xsip/ngx-ssr-code-remover
Last synced: 3 months ago
JSON representation
Post processor to remove SSR Code from bundles when served
- Host: GitHub
- URL: https://github.com/xsip/ngx-ssr-code-remover
- Owner: xsip
- Created: 2024-07-21T11:47:15.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-24T19:02:16.000Z (4 months ago)
- Last Synced: 2024-07-25T13:51:47.580Z (4 months ago)
- Language: HTML
- Size: 2.06 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-angular - ngx-ssr-code-remover - Post processor to remove SSR Code from bundles when served. (Table of contents / Angular)
- fucking-awesome-angular - ngx-ssr-code-remover - Post processor to remove SSR Code from bundles when served. (Table of contents / Angular)
- fucking-awesome-angular - ngx-ssr-code-remover - Post processor to remove SSR Code from bundles when served. (Table of contents / Angular)
README
# ngx-ssr-code-remover
**ngx-ssr-remover** will post-process your angular bundle in your express server and serve bundles with ssr code removed
![alt text](https://github.com/xsip/ngx-ssr-code-remover/blob/main/preview.png?raw=true)
# Setup
``` npm i [email protected]:xsip/ngx-ssr-code-remover.git```Your express server should contain the following to lines.
```javascript
...
import {removeSsrCodeV2} from "ngx-ssr-remover";server.set('view engine', 'html');
server.set('views', browserDistFolder);// add those two lines to your express server
removeSsrCodeV2.removeServerCode(browserDistFolder);
removeSsrCodeV2.serveJsFromNoSsr(server,browserDistFolder);server.get('**', express.static(browserDistFolder, {
maxAge: '1y',
index: 'index.html',
}));...
```To Automatically remove functions using the post-processor, decorate your component functions:
```typescript
...
import {RemoveOnServe} from "ngx-ssr-remover/dist/decorator";@RemoveOnServe()
test() {
console.log('HI');
}```
Feel free to write tickets when you encounter some issue.