metro
metro copied to clipboard
How can I set entry file?
I'm trying to move my index.ts to the ./src/index.ts folder.
In the metro configuration I set: projectRoot: path.resolve(__dirname, './src'),
And I receive an error
Error: Unable to resolve module ./index.
It tries to find file in the root directory, and not the src.
I also have tried to add "main" field to the package.json with
<rootDir>/src/index.tsx
./src/index.tsx
as the concepts section of the doc says:
Metro is a JavaScript bundler. It takes in an entry file and various options, and gives you back a single JavaScript file that includes all your code and its dependencies.
how could we use a custom entry file ?