1

Just started learning React js and then I found this enterprise-level react application framework called Umi. Since I am just a beginner with Node js too, I am having a hard time understanding what really happened after I typed 'umi dev' in the command line.

I spent some time digging into the source code. My current guess is that somehow umi used another js library called 'webpack-dev-server' to actually run an express server locally. However, I am still confused on how the 'umi dev' command makes all these things happen. Is 'dev' a command? Or is it a class? What should people do if they want a new command like 'umi my-own-command'?

P Varga
  • 19,174
  • 12
  • 70
  • 108
NJUHOBBY
  • 850
  • 3
  • 10
  • 30
  • This seems to be only the 2nd question here about UmiJS, so I think you're unlikely to get an answer. It's worth asking in Umi's support channels directly – P Varga May 04 '19 at 09:33
  • Anyhow, by running `which umi`, you will see the path for the `umi` script, likely it is a JavaScript script which parses its command-line options like "dev" and acts accordingly – P Varga May 04 '19 at 09:38

1 Answers1

0

umi is installed by yarn global add umi

i think, you can take a look about ~/.config/yarn/global/node_modules/umi
There's an introduction to umi

there is a file package.json
directorys lib, bin, scripts. and so on

i hope this helps you