|
6 | 6 |
|
7 | 7 | . to Ignite our app - Bundler eg : vite,parcel,webpack
|
8 | 8 |
|
9 |
| -In create react-app, they use webpack bundler |
| 9 | +. In create react-app, they use webpack bundler |
10 | 10 |
|
11 |
| -Bundler is package/module of javascript code |
| 11 | +. Bundler is package/module of javascript code |
12 | 12 |
|
13 |
| -to have a package in code -> we need Package Manager (eg : npm, yarn) |
| 13 | +. to have a package in code -> we need Package Manager (eg : npm, yarn) |
14 | 14 |
|
| 15 | +``` |
15 | 16 | npm init -> create package.json -> initialise our repo with npm
|
16 | 17 | npm init -y -> to skip configuration
|
| 18 | +``` |
17 | 19 |
|
18 |
| -why npm ? |
| 20 | +. why npm ? |
19 | 21 | helper packages -> React app is powered by a lot of packages for bundling, optimizing, minifying
|
20 | 22 | maven : java :: rnpm : react
|
21 | 23 |
|
22 |
| -Parcel : |
| 24 | +`Parcel` : |
| 25 | + |
| 26 | +``` |
23 | 27 | npm install package-name -> to install a package named package-name & node modules (helper functions )is created
|
24 | 28 |
|
25 | 29 | npm install -d package-name -> -D means dev dependency or --save-dev
|
26 | 30 |
|
| 31 | +``` |
| 32 | + |
27 | 33 | package-lock.json is created and parcel code is updated in node modules
|
28 | 34 |
|
29 | 35 | parcel is in dev dependencies of package-lock - parcel is needed in dev environment
|
30 |
| -~ update for major version |
31 |
| -^ automatic update for minor version |
32 |
| -without anything - exact version |
33 | 36 |
|
34 | 37 | if update happens, package.json is updated but package-lock.json is not updated
|
35 | 38 |
|
36 | 39 | package-lock.json - dont ignore in git
|
37 |
| -but put node modules in gitignofa-rotate-180 |
| 40 | +but put node modules in .gitignore |
38 | 41 |
|
39 |
| -if i have package-lock.json -> i can regenerate node modules |
| 42 | +if we have package-lock.json -> we can regenerate node modules |
40 | 43 |
|
41 |
| -react cdn - not good way |
| 44 | +react cdn - is not a good way |
42 | 45 | Good way -> in server thrugh node modules
|
43 | 46 |
|
44 | 47 | npm install react -> in global dependencies not dev dependencies
|
|
0 commit comments