Brunch

JavaScript开发工具大全

有些话、适合烂在心里 提交于 2019-12-22 21:01:02
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 译者按: 最全的JavaScript开发工具列表,总有一款适合你! 原文: THE ULTIMATE LIST OF JAVASCRIPT TOOLS 译者: Fundebug 为了保证可读性,本文采用意译而非直译。另外,本文版权归原作者所有,翻译仅用于学习。 简介 2017年1月,Stack Overflow年度开发者调研一共访问了64000个程序员,发现JavaScript已经连续5年成为最流行的编程语言。 这篇博客将介绍一些常用的JavaScript开发工具: 构建&自动化 · IDE&编辑器 · 文档 · 测试 · 调试 · 安全 · 代码优化&分析 · 包管理 ##构建 & 自动化 Webpack对JavaScript应用依赖的所有模块进行静态分析,生成依赖图,然后将它们打包成数个静态文件。 Grunt以将重复耗时的任务自动化。Grunt的生态系统非常大,有超过6010个插件。 Gulp发布于Grunt之后,采用了完全不同的方式,使用JavaScript函数定义任务。它有超过2770个插件,并且提供了更好的控制。 Browserify使得开发者可以在浏览器使用CommonJS模块。开发者像在node环境一样,通过require('modules')来组织模块之间的引用和依赖

Brunch how to disable RequireJS module wrapping

夙愿已清 提交于 2019-12-21 03:53:07
问题 Update: For anyone interested in using Brunch with AngularJS I've put together a seed project angular-brunch-seed I'm using Brunch with AngularJS. AngularJS provides a module system so the need for importing file using commonJS / AMD is redundant. Is it possible to disable this feature for files in the /app directory? Essentially I would like it to compile files unaltered like it does for the /vendor directory. So the preferred out come would be: joinTo: 'js/app.js': /^app/ 'js/vendor.js': /

Loading vendor javascript as modules

别来无恙 提交于 2019-12-13 12:09:00
问题 I'm working on an application built with Brunch. I would like to load some* of the vendor-supplied javascript as modules, so that I can require them in my code, rather than relying on global variables. Is there some way to do this, without copying all the vendor code into my app directory? I tried creating a vendorlib directory, but brunch doesn't seem to look anywhere bu app and vendor . I also tried making a vendor/modules directory, but brunch seems to not wrap anything found under vendor

Brunch source mapping: not hitting breakpoints in Chrome devtools

亡梦爱人 提交于 2019-12-12 10:57:04
问题 I'm using the default source mapping built into Brunch. I see the files fine, but I cannot hit breakpoints within the source mapped files. Using the Javascript access to the debugger via debugger; works, which leads me to believe it's something wrong with the Brunch side of things. Here is my brunch-config.js: module.exports = { files: { javascripts: { joinTo: { 'js/vendor.js': /^(?!source\/)/, 'js/app.js': /^source\// }, entryPoints: { 'source/scripts/app.jsx': 'js/app.js' }, order: { before

Brunch: how to wrap vendor code in AMD modules?

坚强是说给别人听的谎言 提交于 2019-12-11 11:59:40
问题 I want all vendor code to be wrapped in AMD modules. I have defined this section in my config.coffee: modules: wrapper: 'amd' definition: 'amd' But it seems like brunch uses AMD optimizer only for 'app' folder files. All vendor js files where concatinated without any r.js-like preprocessing(no module names added in "define(...)" statements). As a result, Almond(it's almost the same as RequireJS) complains about anonymous module definition during vendor file executing. Here is my full config:

JS compiled by Brunch does not run

倾然丶 夕夏残阳落幕 提交于 2019-12-11 05:00:07
问题 I wanted to try out Brunch and am having some trouble getting my compiled JS files to execute in the browser. The file gets compiled and loaded by the page into the browser. If I stick an alert or a console log in the source files and do a build, then nothing happens when I load the page. If I edit the file manually and put a console log or an alert into it then it works just fine. Does anyone have any ideas? I feel like I'm probably just missing something silly. This is what I have in my

Control order of script concatenation using Brunch

↘锁芯ラ 提交于 2019-12-10 02:34:52
问题 What is the best practice for controlling the order in which scripts / stylesheets are concatenated when using Brunch? A simple version of my problem involves an application using Twitter Bootstrap, which requires jQuery. Bootstrap requires that jQuery is loaded first. Initially I had the following in my vendor/ directory: jquery-1.9.1.min.js and bootstrap.min.js Which was concatenated by Brunch into my vendor.js file in alphabetical order, namely, bootstrap first. To solve this I appended a

How can I tell Brunch not to concatenate javascript files?

点点圈 提交于 2019-12-08 07:27:09
问题 Does anyone know how to configure Brunch not to concatenate javascript files in the local build? I want the javascript files copied straight over so that I do not have one large javascript file when debugging. Here's my current brunch-config.coffee file: exports.config = conventions: ignored: /.+\.spec\.js/ files: javascripts: joinTo: 'js/app.js': /^app/ 'js/vendor.js': /^(vendor|bower_components)/ stylesheets: joinTo: 'css/common.css': /^app/ templates: joinTo: 'js/templates.js': /^app/ 回答1:

Brunch installed with phoenix app doesn't work with bower assets

扶醉桌前 提交于 2019-12-08 02:20:17
问题 I have created Phoenix 1.0.4 (Elixir) application. After I had added some logic in application I wanted to switch my work for front-end part. On page http://www.jonathanbirkholz.com/how-to-use-font-awesome-on-phoenix/ I read that for 3rd assets I should use Bower. Unfortunately with font-awesome or bootstrap-sass from Bower and with command brunch build I always receive: /.../my_app/node_modules/acorn/dist/acorn.js:1747 throw err; ^ SyntaxError: Unexpected token (2:10) at Parser.pp.raise (/..

Vendor CSS files not being compiled for Brunch

故事扮演 提交于 2019-12-07 02:55:02
问题 I am having an issue with brunch@1.7.6 not compiling bower_component css files. Similar to Separating app and vendor css in Brunch. Only the css/app.css is getting generated for me. :/ { stylesheets: { joinTo: { 'css/app.css': /^app/, 'css/vendor.css': /^bower_components/ } } Please let me know if I am doing something wrong. All seemed fine when I was using brunch@1.6.7. Did the config change with the introduction to bower being built in? 回答1: With regards to x-editable , I ran into the