美文网首页
webpack随记

webpack随记

作者: 穆熙沐 | 来源:发表于2021-03-05 14:06 被阅读0次

    1,package.json中script选项作用

    {
      "name": "demo",
      "version": "1.0.0",
      "private": true,
      "scripts": {
        "start": "nuxt start",
        "generate--dev": "BASE_URL='https://dev.yygongzi.com' nuxt generate",
        "generate--demo": "BASE_URL='https://demo.yygongzi.com' nuxt generate",
        "generate": "BASE_URL='https://www.yygongzi.com' nuxt generate"
      },
      "dependencies": {
        "@nuxtjs/axios": "^5.4.1",
        "axios": "^0.19.0",
        "cross-env": "^5.2.0",
        "element-ui": "^2.4.11",
        "koa": "^2.6.2",
        "md5": "^2.2.1",
        "msgpack-lite": "^0.1.26",
        "nuxt": "^2.4.0"
      },
      "devDependencies": {
        "nodemon": "^1.18.9",
        "stylus": "^0.54.5",
        "stylus-loader": "^3.0.2"
      }
    }
    
    

    上述配置npm run generate会执行 BASE_URL='https://www.yygongzi.com' nuxt generate
    npm run 如果不加任何参数,默认会列出package.json中所有可以执行的脚本命令。
    npm 内置了两个命令 npm test : npm run test; npm start:npm run start。

    相关文章

      网友评论

          本文标题:webpack随记

          本文链接:https://www.haomeiwen.com/subject/xmwqqltx.html