metro icon indicating copy to clipboard operation
metro copied to clipboard

How can I set entry file?

Open alexmbp opened this issue 7 years ago • 1 comments

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

alexmbp avatar Apr 12 '19 12:04 alexmbp

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 ?

KingAmo avatar Jun 05 '20 02:06 KingAmo