早午餐坚持"尝试加载brunch-config"

时间:2018-03-18 21:13:39

标签: elixir phoenix-framework brunch

背景

我有一个elixir / phoenix项目,使用默认的早午餐设置(有一些像sass和反应的添加物)。

它已经有一段时间了,但今天它自发地停止编译任何东西,我无法弄清楚原因。

症状

enter image description here

当我运行brunch build --stdinbrunch watch --stdin时,它就会挂起。没有任何内容打印到控制台,没有编译,没有错误。

当我运行brunch watch --debug --stdin

打印:

brunch:config Trying to load brunch-config +0ms

没有别的。据推测,它实际上从未加载过brunch-config。

到目前为止我做了什么

  • 仔细检查它仍适用于其他凤凰项目
  • 删除所有deps / node_modules,重新安装,然后重试。

早午餐-config.js



exports.config = {
  files: {
    javascripts: {
      joinTo: "js/app.js"
    },
    stylesheets: {
      joinTo: "css/app.css"
    },
    templates: {
      joinTo: "js/app.js"
    }
  },

  conventions: {
    assets: /^(static)/
  },

  paths: {
    watched: ["static", "css", "js", "vendor"],
    public: "../priv/static"
  },

  plugins: {
    postcss: {
        processors: [
            require('autoprefixer')(['last 8 versions']),
            require('csswring')()
        ]
    }
  },

  modules: {
    autoRequire: {
      "js/app.js": ["js/app"]
    }
  },

  npm: {
    enabled: true
  }
};




.babelrc



{
  "presets": ["env", "stage-2", "react", "flow"],
  "env": {
      "development": {
          "sourceMaps": "inline",
          "plugins": ["source-map-support"]
      }
  },
  "plugins": [
    "syntax-object-rest-spread",
    "transform-flow-strip-types",
    "transform-es2015-destructuring",
    "transform-es2015-parameters",
    "transform-object-rest-spread",
    ["transform-runtime", {
      "helpers": false,
      "polyfill": false,
      "regenerator": true,
      "moduleName": "babel-runtime"
    }]
  ]
}




的package.json



{
  "repository": {},
  "name": "ewb",
  "version": "1.0.0",
  "license": "MIT",
  "scripts": {
    "deploy": "brunch build --production",
    "watch": "brunch watch --stdin",
    "test": "NODE_ENV=test jest --verbose"
  },
  "jest": {
    "testEnvironment": "node",
    "transform": {
      "^.+\\.jsx?$": "babel-jest"
    }
  },
  "dependencies": {
    "autobind-decorator": "^2.1.0",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react": "^6.24.1",
    "babel-runtime": "^6.26.0",
    "extensible-runtime": "^4.1.0",
    "immutable": "^3.8.2",
    "lodash": "^4.17.5",
    "normalize-scss": "^7.0.1",
    "normalizr": "^3.2.4",
    "phoenix": "file:../deps/phoenix",
    "phoenix_html": "file:../deps/phoenix_html",
    "react": "^16.2.0",
    "react-phoenix": "file:../deps/react_phoenix",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2",
    "redux-devtools": "^3.4.1",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.2.0"
  },
  "devDependencies": {
    "autoprefixer": "^8.0.0",
    "babel-brunch": "^6.1.1",
    "babel-cli": "^6.26.0",
    "babel-core": "^6.26.0",
    "babel-jest": "^22.4.1",
    "babel-plugin-extensible-destructuring": "^4.2.0",
    "babel-plugin-syntax-object-rest-spread": "^6.13.0",
    "babel-plugin-transform-es2015-destructuring": "^6.23.0",
    "babel-plugin-transform-es2015-parameters": "^6.24.1",
    "babel-plugin-transform-es2015-spread": "^6.22.0",
    "babel-plugin-transform-flow-strip-types": "^6.22.0",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-flow": "^6.23.0",
    "babel-preset-stage-2": "^6.24.1",
    "brunch": "2.10.9",
    "clean-css-brunch": "2.10.0",
    "csswring": "^6.0.3",
    "flow-bin": "^0.66.0",
    "flow-brunch": "^0.2.4",
    "jest": "^22.4.2",
    "node-sass": "^4.7.2",
    "postcss-brunch": "^2.1.0",
    "regenerator-runtime": "^0.11.1",
    "sass-brunch": "^2.10.4",
    "uglify-js-brunch": "2.10.0"
  }
}




1 个答案:

答案 0 :(得分:0)

重新启动我的电脑,它现在正在工作。