问题标签 [brunch]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
node.js - 从 UglifyMinifier.optimize 在 Heroku 上使用早午餐时 NPM 中的 TypeError
我最近将早午餐和相关库(例如,uglify-js-brunch)升级到 1.7.x。推送到 Heroku 时,我在下面粘贴了错误。关于如何解决这个问题的任何线索?
谢谢!
ember.js - 延迟加载的 Ember 应用程序
我通常在这里寻找答案,但我最终到了找不到好的答案的地步。
我正在寻找构建一个 ember 应用程序,该应用程序最初仅加载启动和打开主要路线所需的东西。当触发特定路由时,所有其他控制器、视图、模板等都会延迟加载。
我在这里找到了一个很好的例子来说明如何做到这一点:http: //madhatted.com/2013/6/29/lazy-loading-with-ember
我的主要问题是确定哪些构建工具支持这种延迟加载应用程序代码的理论?到目前为止,我已经看到 Brunch、Yeoman 和 Ember App Kit 似乎缩小并连接了所有脚本和模板。我对缩小感到非常满意,但需要将这些文件分开。我曾考虑将这段代码放入 app/assets 位置,以便在没有 concat 的情况下复制它,但它不会被缩小。
有没有人有办法解决吗?谢谢!
configuration - 如何仅对一个文件禁用模块包装
我想避免<script>require('app')<script>
在我的 index.html 上,我该如何实现呢?
我认为使用正则表达式,但我对它们不是很熟练,关于配置的文档对我来说不是那么清楚......
perl - 早午餐构建后如何保持perl文件可执行?
我们已经开发了一个包含早午餐的网站,但现在我们面临一个问题。
一个可执行(许可模式:755)perl 脚本位于文件夹 app/assets/ 中。执行 brunch build 后,生成的 perl 脚本不再可执行,CGI 也无法调用。除了构建或创建软链接后的chmod,还有其他解决方案吗?
谢谢。
javascript - 类型错误:require.config 不是函数
我正在使用 require.js 作为早午餐项目的一部分。此代码引发错误:
这是否意味着 requirejs 没有正确包含在项目中?
requirejs - Marionette JS 模块、Brunch JS 和 require JS 项目结构
我正在使用 BrunchJS 来处理咖啡脚本和资产编译。该项目使用了几个Brunch插件,例如需要“commonjs”包装器才能运行的brunch-handlebar。
从我的config.coffee中提取
在 Marionette 方面,我可以很好地加载一个简单的应用程序。
索引.html
应用程序.coffee
# 加载把手块助手需要'lib/view_helper'
从那里开始我如何使用 Marionette JS 模块?我在这里阅读了有关使用 AMD 模块的信息https://github.com/marionettejs/backbone.marionette/wiki/AMD-Modules-vs-Marionette 's-Modules 但我不能在我的木偶模块定义中使用define关键字,因为“定义”和“要求”没有公开。Brunch 只使用它来加载它的插件和我的应用程序源文件。
一个常见的 Marionette 模块如下所示:
在一个单独的文件moduleA.coffee我试图做:
但是定义 没有定义。
我也尝试过:
但后来我需要在 application.coffee 中要求我所有的木偶模块(“moduleA”)并遇到一些循环依赖问题。
我正在考虑的解决方案之一是禁用BrunchJS commonjs 包装并从供应商文件夹加载把手,而不是作为早午餐插件。
brunch - 为什么 brunch 不从 /app 的子目录添加 javascript?
我有一个 brunch config.coffee 文件,~/lens/v
其中包括以下几行:
Brunch 获取位于 /app 目录根目录的扩展名为 .js 的文件,并将它们连接到 app.js 中——但它不会连接位于 /app 子目录中的文件。
具体来说,我正在尝试将早午餐添加到位于以下位置的咖啡脚本文件中~/lens/v/app/assets
我能够像这样构建项目
但是当我在 app.js 文件中搜索“d3”时,我找不到它。由于某种原因,JS 没有被连接起来。
配置文件中的这一行javascripts/app.js': /^app/
应该将 /app 中的任何 javascript 文件连接到 app.js。但这并没有发生。当我将 javascript 文件的扩展名更改为 .js(从 .coffee)时,我得到了相同的行为。
我可以采取哪些步骤来调试它?
brunch - How can I compile individual CoffeeScript files in the assets directory?
I have an application built in Brunch.io that builds the main framework into app.js, but in my assets folder I have various small coffeescript scripts that need to be compiled individually, and not merged together into one.
Is there a way to compile the CS first and then move it to the public folder like everything else in assets?
I notice that there are some plugins for doing this exact thing with Jade templates (so you can have .jade files in your assets folder). Would this need to be a new plugin?
If there's no obvious way to do it, is there at least a way to define the config file so that it can watch a different folder and compile each .coffee file to it's own .js file, without either joining them all together, or needing to specify each file in the config?
handlebars.js - 将 Handlebars 助手添加到脚手架
如何将 Handlebars 助手添加到scaffolt
附带的处理中brunch
?我想在我的脚手架模板中做一些更有趣的条件语句,但需要了解这个过程。
哦,还有,有没有人有任何聪明的助手可以查看名称并推断该名称是单数还是复数?