1

我在 Windows 10 x64 上,源位于 NFS 单元上。

当我运行脚本时,它给了我这个:

npm run-script watch

> fooprog@1.0.0 watch U:\fooprog
> watchify -v --poll index.js -o ./dist/main.js

471 bytes written to ./dist/main.js (0.01 seconds) at 11:08:08

然后它就停止了。

带有browserify的“构建”脚本就像一个魅力,所以它不是我的Javascript代码中的语法错误,我想。

我的 package.json:

 "scripts": {
    "watch": "watchify -v --poll index.js -o ./dist/main.js",
    "build": "browserify index.js -o  ./dist/main.js"
  },
  "browserify": {
    "transform": [
      [
        "babelify"
      ]
    ]
  },
  "devDependencies": {
    "@babel/core": "^7.7.5",
    "@babel/plugin-transform-async-to-generator": "^7.7.4",
    "@babel/preset-env": "^7.7.6",
    "babelify": "^10.0.0",
    "browserify": "^16.3.0",
    "serve": "^11.2.0",
    "uglify-js": "^3.7.2",
    "watchify": "^3.11.1"
  }

.babelrc:

{
  "presets": [
    "@babel/preset-env"
  ],
  "plugins": [
    "@babel/plugin-transform-async-to-generator"
  ]
}
4

0 回答 0