From 790ab575d70cb4f7c626a12bceb0f26bb4ad9e1d Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Wed, 29 Nov 2023 00:25:29 +0100 Subject: [PATCH] Allow arbitrary extensions for app-imports With a config like `allowAppImports: ['images/**/*.webp']` and importing a file like `image.webp`, eai would fail to handle that import properly, as it assumes that explicit extensions would be 1-3 characters long. With a proper webpack loader we can make it import any type of file, so we shouldn't make assumptions about the possible extensions. --- packages/ember-auto-import/ts/webpack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ember-auto-import/ts/webpack.ts b/packages/ember-auto-import/ts/webpack.ts index aedba9c8..75709f57 100644 --- a/packages/ember-auto-import/ts/webpack.ts +++ b/packages/ember-auto-import/ts/webpack.ts @@ -419,7 +419,7 @@ export default class WebpackBundler extends Plugin implements Bundler { *withResolvableExtensions( importSpecifier: string ): Generator { - if (importSpecifier.match(/\.\w{1,3}$/)) { + if (importSpecifier.match(/\.\w+$/)) { yield importSpecifier; } else { for (let ext of EXTENSIONS) {