DevOps has requested that we limit our frontend builds to ~1GB of RAM, so that our Jenkins instance doesn\'t shut down. We use a standard @vue/cli
project, with Typ
in vue.config.js
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const os=require('os');
module.exports = {
//......,
chainWebpack: config => {
config
.plugin('fork-ts-checker')
.tap(args => {
let totalmem=Math.floor(os.totalmem()/1024/1024); //get OS mem size
let allowUseMem= totalmem>2500? 2048:1000;
// in vue-cli shuld args[0]['typescript'].memoryLimit
args[0].memoryLimit = allowUseMem;
return args
})
},
//......
}