NodeJs – CodeWeb https://codeweb.wall-spot.com Code the web easy Wed, 08 Jun 2022 04:17:08 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://i0.wp.com/codeweb.wall-spot.com/wp-content/uploads/2022/06/code-web.png?fit=32%2C32&ssl=1 NodeJs – CodeWeb https://codeweb.wall-spot.com 32 32 214557421 What Is The Difference Between NPM Run Dev And NPM Run Production? https://codeweb.wall-spot.com/what-is-the-difference-between-npm-run-dev-and-npm-run-production/ Wed, 08 Jun 2022 04:17:08 +0000 https://codeweb.wall-spot.com/?p=5 What are npm run dev and npm run production? What does it do?

NPM RUN DEV will compile all your assets including a source map. This basically makes it easier to inspect any errors in the developer tools in the console in your browser.

If you open the file public/css/app.css for example you can see that everything is in one file but not read.

NPM RUN PRODUCTION will actually minify everything and not create a source map for the files. However, since it’s modified the files are smaller and harder to read.

In general, you run npm run dev locally, and npm run production before you deploy your application. This can either be done locally before committing or during your deployment.

]]>
5