Skip to content

sourceExts and assetExts missing from resolver  #1010

@tiagomsmagalhaes

Description

@tiagomsmagalhaes

Do you want to request a feature or report a bug?

A bug

What is the current behavior?

sourceExts and assetExts are missing from getDefaultConfig(__dirname).resolver. I'm using them to parse scss and svg files like such

module.exports = (async () => {
  const {
    resolver: {sourceExts, assetExts},
  } = await getDefaultConfig();
  return {
    transformer: {
      getTransformOptions: async () => ({
        transform: {
          experimentalImportSupport: false,
          inlineRequires: false,
        },
      }),
      babelTransformerPath: require.resolve('./rn-transformer.js'),
    },
    resolver: {
      assetExts: assetExts.filter(ext => ext !== 'svg'),
      sourceExts: [...sourceExts, 'scss', 'css', 'pcss', 'sass', 'svg'],
    },
  };
})();

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.

Repo

yarn install && yarn start

What is the expected behavior?

Currently sourceExts and assetExts are missing from getDefaultConfig(__dirname).resolver as it would on the log after starting the project

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

node v16.17.1
yarn version v1.22.19
Ventura 13.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions