using import () syntax to load the module asynchronously in the typescript+react project built by create-react-app, it is found that everything is normal in the development environment. The module can be loaded in NODE_ENV = production
, but the code cannot be executed. I tried different asynchronous loading tools and found that the import () method is actually encapsulated under the analysis, so it is guessed that it is the problem of import ()? It"s not long since I started typescript. I don"t know what"s going on.
below is a screenshot. After build, only loading components or Error components are displayed. The actual components see that the network has been loaded but not executed.