How to use webpack-chain to add appendTsSuffixTo options to ts-loader? How to use webpack-chain to add appendTsSuffixTo options to ts-loader? vue.js vue.js

How to use webpack-chain to add appendTsSuffixTo options to ts-loader?


Look into the section on modifying options for loaders:

config.module  .rule('typescript')  .use('ts-loader')    .tap(options => merge(options, {      appendTsSuffixTo: [/\.vue$/]    }));

Update

Here's the relevant docs for merging objects.

This GitHub thread provides good examples.

// preserve existing optionsconfig.module  .rule('typescript')  .use('ts-loader')    .tap(options => ({ ...options, {      appendTsSuffixTo: [/\.vue$/]    }}));