diff --git a/changelog/_unreleased/2023-07-06-allow-typescript-in-the-storefront.md b/changelog/_unreleased/2023-07-06-allow-typescript-in-the-storefront.md new file mode 100644 index 00000000000..ba9ef9ce2dd --- /dev/null +++ b/changelog/_unreleased/2023-07-06-allow-typescript-in-the-storefront.md @@ -0,0 +1,6 @@ +--- +title: Allow typescript in the storefront +issue: NEXT-29105 +--- +# Storefront +* Added extension alias in webpack config for javascript files to check for typescript files first and then javascript files diff --git a/src/Storefront/Resources/app/storefront/webpack.config.js b/src/Storefront/Resources/app/storefront/webpack.config.js index 46fc435b7a6..f95dffa3814 100644 --- a/src/Storefront/Resources/app/storefront/webpack.config.js +++ b/src/Storefront/Resources/app/storefront/webpack.config.js @@ -324,6 +324,9 @@ let webpackConfig = { ], resolve: { extensions: [ '.ts', '.tsx', '.js', '.jsx', '.json', '.less', '.sass', '.scss', '.twig' ], + extensionAlias: { + '.js': ['.ts', '.js'], + }, modules: [ // statically add the storefront node_modules folder, so sw plugins can resolve it path.resolve(__dirname, 'node_modules'),