Can webpack-encore use the tsconfig.json for aliases?

109 Views Asked by At

The typescript path configurations were not in sync with the webpack aliases in a symfony project that I was working on, because they were in two separate files. I found no obvious way to use the tsconfig.json paths as aliases with encore.

I tried installing the tsconfig-paths-webpack-plugin and adding it with the addPlugin method.

const Encore = require('@symfony/webpack-encore');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');

Encore
.addPlugin(new TsconfigPathsPlugin());

And I got this when I ran webpack:

tsconfig-paths-webpack-plugin: No file system found on resolver. Please make sure you've placed the plugin in the correct part of the configuration. This plugin is a resolver plugin and should be placed in the resolve part of the Webpack configuration.

0

There are 0 best solutions below