cli: add json and wasm extensions to webpack resolve config

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-08-08 17:50:20 +02:00
parent 5b830da1b1
commit fd68d6f138
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Added resolution of `.json` and `.wasm` files to the Webpack configuration in order to match defaults.
+2 -2
View File
@@ -162,7 +162,7 @@ export async function createConfig(
context: paths.targetPath,
entry: [require.resolve('react-hot-loader/patch'), paths.targetEntry],
resolve: {
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json', '.wasm'],
mainFields: ['browser', 'module', 'main'],
fallback: {
...pickBy(require('node-libs-browser')),
@@ -272,7 +272,7 @@ export async function createBackendConfig(
paths.targetRunFile ? paths.targetRunFile : paths.targetEntry,
],
resolve: {
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json'],
mainFields: ['main'],
modules: [paths.rootNodeModules, ...moduleDirs],
plugins: [