首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Elm-Brunch编译问题:未定义的'split‘

Elm-Brunch编译问题:未定义的'split‘
EN

Stack Overflow用户
提问于 2016-03-06 00:31:05
回答 1查看 183关注 0票数 5

我的Elm代码(https://github.com/puruzio/seat_saver)在Elm Reactor中工作得很好,并且可以用elm-make编译得很好,但是当我通过早午餐编译它时,我得到了以下错误。这并没有给我多少关于在哪里修复错误的线索。

代码语言:javascript
复制
My-MacBook-Pro:seat_saver_old puruzio$ brunch build
Elm compile: Main.elm, in web/elm, to ../static/vendor/main.js
[BABEL] Note: The code generator has deoptimised the styling of "web/elm/app.js" as it exceeds the max of "100KB".
[BABEL] Note: The code generator has deoptimised the styling of "web/elm/elm.js" as it exceeds the max of "100KB".
05 Mar 16:16:51 - info: compiling
05 Mar 16:16:54 - error: [TypeError: Cannot read property 'split' of undefined]

我的项目基于在这里找到的示例http://www.cultivatehq.com/posts/phoenix-elm-10/,我试图在不同的文件中添加多个模块。

brunch-config.js

代码语言:javascript
复制
exports.config = {
  // See http://brunch.io/#documentation for docs.
  files: {
    javascripts: {
      joinTo: "js/app.js"
    },
    stylesheets: {
      joinTo: "css/app.css"
    },
    templates: {
      joinTo: "js/app.js"
    }
  },

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

  // Phoenix paths configuration
  paths: {
    // Dependencies and current project directories to watch
    watched: [
      "deps/phoenix/web/static",
      "deps/phoenix_html/web/static",
      "web/static",
      "test/static",
      "web/elm"
    ],

    // Where to compile files to
    public: "priv/static"
  },

// Configure your plugins
plugins: {
 babel: {
   // Do not use ES6 compiler in vendor code
   ignore: [/web\/static\/vendor/]
 },
 elmBrunch: {          //<<<<<<<< Here is the elmBrunch configuration
   elmFolder: 'web/elm',
   mainModules: ['Main.elm'],
   outputFolder: '../static/vendor'
 }
} ,

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

 npm: {
   enabled: true
 }
};
EN

回答 1

Stack Overflow用户

发布于 2016-09-19 04:30:01

您可以在brunch-config.js的plugins - babel部分中添加以下内容

代码语言:javascript
复制
compact: false

代码语言:javascript
复制
plugins: {


babel: {
   // Do not use ES6 compiler in vendor code
   ignore: [/web\/static\/vendor/],
   compact: false
 },
 elmBrunch: {          //<<<<<<<< Here is the elmBrunch configuration
  ...
 }
} 
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35816662

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档