A
A
Andrej Kopp2021-04-09 19:55:38
npm
Andrej Kopp, 2021-04-09 19:55:38

How to rewrite scripts section in packages.json file?

I have a package that runs on Laravel 7 and would like to rewrite it for Laravel 8. The problem is Laravel-Mix. The old version of the script had support:

"laravel-mix": "^5.0.4",

The new version defaults to:

"laravel-mix": "^6.0.16",

I have this scripts section in my package's packages.json file:

"scripts": {
    "dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
    "build": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
    "lint": "eslint --ext .js,.vue resources/assets/js"
  },


Scrolling through the laravel -mix update document , I realized that a number of changes appeared in the 6th version. So I need to change my section to something like this:

"scripts": {
    "development": "mix",
    "watch": "mix watch",
    "watch-poll": "mix watch -- --watch-options-poll=1000",
    "hot": "mix watch --hot",
    "production": "mix --production"
}


Can someone help me rewrite the old code with the new one?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrej Kopp, 2021-04-09
@sequelone

If I understand correctly, it should look like this:

"scripts": {
    "build": "mix",
    "dev": "mix watch",
    "lint": "eslint --ext .js,.vue resources/assets/js"
  },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question