How to write to the dist folder after npm start and then execute build?

each time you execute npm start, it empties the dist folder and writes back to the dist folder. But the lack of external file references after packaging, the need to execute npm build, alone is very troublesome, how to easily execute these two commands?
here is a partial configuration of package.json:

    "scripts": {
        "start": "better-npm-run start",
        "clean": "better-npm-run clean",
        "build:echarts": "better-npm-run build:echarts",
    },
     "betterScripts": {
         "build:echarts": {
              "command": "node node_modules/echarts/build/build.js --min -i src/components/echarts/index.js -o dist/bond/static/js/echarts.min.js",
              "env": {
                "NODE_ENV": "production"
              }
          }
     }

"start": "better-npm-run start\" npm build\ ",

use gulp for task flow management


" compile ":" better-npm-run start & & better-npm-run build:echarts "

Menu