-
-
Notifications
You must be signed in to change notification settings - Fork 199
Open
Labels
Description
I wanted to improve build times for ts
files by using the thread-loader
. In order to do this I need to prepend the thread-loader
ahead of the encore-build loaders. I did an ugly hack to get it to work, but it would be nice feature to allow more granular control.
This is my hack-around.
const pack = Encore.getWebpackConfig();
pack.module.rules.forEach(rule => {
if (rule.test.test('.ts')) {
// this could be configured above, but this way all the threading config is in one place.
rule.use.forEach(loader => {
if (loader.loader === 'ts-loader') {
loader.options.happyPackMode = true;
}
})
rule.use.unshift({loader: 'thread-loader', options: {
workers: 2
}})
}
})
Unrelated issue where the same request is made: #249