Fix npm dev build instructions

This commit is contained in:
John Molakvoæ
2019-04-18 08:29:22 +02:00
committed by GitHub
parent 5c1325f5f2
commit a9e2fccd63

View File

@@ -23,7 +23,7 @@ For apps that use webpack, this might look like this:
{
"name": "myapp",
"scripts": {
"build": "webpack --progress --config webpack.prod.js"
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.prod.js"
},
"devDependencies": {
"webpack": "^4.26.1",
@@ -35,22 +35,23 @@ You can then run ``npm build`` in your app's root directory to invoke the build
See the `npm-build docs https://docs.npmjs.com/cli/build`_ for more info.
npm run watch
-------------
npm run dev, npm run watch
--------------------------
Since building the release version of JavaScript scripts can be slow, apps often have a dedicated
build step for development that builds faster and enables debug output. Additionally, it instructs
build step for development that builds faster and enables debug output. Additionally, it can instructs
the bundler to listen to file changes and (incrementally) rebuild the project.
This command should be added to ``package.json`` as ``watch`` script:
This command should be added to ``package.json`` as ``dev`` and ``watch`` script:
.. code-block:: json
{
"name": "myapp",
"scripts": {
"build": "webpack --progress --config webpack.prod.js",
"watch": "webpack --progress --config webpack.dev.js --watch"
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.prod.js",
"dev": "NODE_ENV=development webpack --progress --config webpack.dev.js",
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.dev.js"
},
"devDependencies": {
"webpack": "^4.26.1",
@@ -58,7 +59,7 @@ This command should be added to ``package.json`` as ``watch`` script:
}
}
The development build is invoked with ``npm run dev``.
The development build is invoked with ``npm run dev`` or if you want to leave the process running and update on every change made to the source files, ``npm run watch``.
npm test
--------