Heap out of memory #526
-
Hello all, Last week I ran into a I'm using webpack 5, and the configuration is this (...)
const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader';
(...)
module: {
rules: [
{
test: /\.(ts|tsx)$/i,
loader: 'ts-loader',
exclude: ['/node_modules/'],
},
{
test: /\.css$/i,
use: [stylesHandler, 'css-loader', 'postcss-loader'],
},
{
test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i,
type: 'asset',
},
],
},
(...) I've tried vite and works, but I wonder if it would be a matter of time to happen the same. Am I missing or doing anything wrong on the webpack config? My system specs are: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
hello there, after some research, I found two solutions. The first solution is to increase the node memory NODE_OPTIONS=<memory in MB> The second one is to use the option (...) // more imports
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
(...) // start webpack configuration
module: {
(...)
rules: [
{
test: /\.(ts|tsx)$/i,
exclude: ['/node_modules/'],
use: {
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
},
(...)
]
},
plugins: [
(...)
new ForkTsCheckerWebpackPlugin(),
]
(...) // rest of the webpack configuration The second option works better (and faster) check out why |
Beta Was this translation helpful? Give feedback.
hello there, after some research, I found two solutions.
The first solution is to increase the node memory
The second one is to use the option
transpileOnly: true
for thets-loader
on the webpack configuration altogether with thefork-ts-checker-webpack-plugin
plugin dependency.