-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Production build memory consumption #91
Comments
Ok so there seems to be an issue with webpack over-consuming memory while building in production mode. I will check CODEDOC's webpack configuration to see if there is room for optimizing anything via configs, but in the meanwhile I would recommend building on local machine instead of inside a container, or increasing memory limits of the container. To verify this, you can simply run |
So this is the webpack config that results in OOM: {
"resolve": {
"extensions": [
".tsx",
".ts",
".js"
],
"modules": [
".codedoc/node_modules"
]
},
"resolveLoader": {
"modules": [
"node_modules",
".codedoc/node_modules"
]
},
"entry": "/opt/docs/assets/codedoc-bundle.entry.js",
"output": {
"filename": "codedoc-bundle.js",
"path": "/opt/docs/assets"
},
"module": {
"rules": [
{
"test": {},
"use": "ts-loader",
"exclude": {}
}
]
}
} The only work-around right now seems to be turning off type checking on
import { build } from '@codedoc/core';
import { config } from './config';
import { installTheme$ } from './content/theme';
import { content } from './content';
build(config, content, installTheme$, {
mode: 'development', // --> this line is added
resolve: {
modules: ['.codedoc/node_modules']
},
resolveLoader: {
modules: ['.codedoc/node_modules']
}
}); Note that this is really not recommended as it results in bundles that are not minified properly. Generally speaking though, you should not need to build manually except for deployment, where you typically would not have such strict memory limitations. Closing this issue since it does not seem the webpack / ts-loader team intend to tend to this anytime soon (unfortunately). |
How did you figure that out? Did you follow the reproduction steps and reproduce the problem yourself? As a minimal improvement, how about adding output to |
Naturally, also testing with different webpack configurations.
I'm not sure how feasible this is, as the node process itself basically runs out of memory and crashes (webpack is executed on the same node process). |
My previous project at work had a memory issue. It was a .NET application (written in C#). When a request for memory is larger than the available memory, an Does any of this give you an idea for how you can give more feedback when The simplest improvement would be to log before and after |
It does already: # building ........ docs/assets/codedoc-bundle.js
# Build Failed. And I'm not sure about @ntimo , but I do get more detailed error messages when following reproduction steps here as well. |
Hey,
I just wanted to try to use codedoc but for some reason the build always fails for me.
Steps to reproduce:
build output:
The text was updated successfully, but these errors were encountered: