Javascript 为什么早午餐会加入这个requirejs代码?
我在一个使用requirejs的早午餐项目中有一个文件Javascript 为什么早午餐会加入这个requirejs代码?,javascript,requirejs,brunch,Javascript,Requirejs,Brunch,我在一个使用requirejs的早午餐项目中有一个文件app/js/d3.js。当我构建文件时,app/js/d3.js中的代码按预期连接到app.js中。但它被包装在一些看起来需要的代码中,如下所示: require.register("js/d3", function(exports, require, module) { #this wrapper is added window.onload = function() { #then there is the start of code
app/js/d3.js
。当我构建文件时,app/js/d3.js
中的代码按预期连接到app.js
中。但它被包装在一些看起来需要的代码中,如下所示:
require.register("js/d3", function(exports, require, module) { #this wrapper is added
window.onload = function() { #then there is the start of code from app/js/d3.js
我是一个新手,所以我不知道这是应该发生的还是早午餐中的意外行为。当我搜索寄存器时,我没有看到寄存器方法
发生什么事了?为什么我的代码会这样包装?我的config.coffee如下所示:
files:
javascripts:
joinTo:
"js/app.js": /^app/
"js/vendor.js": /^(bower_components|vendor)/
order:
before: [
'bower_components/queue-async/queue.js',
'bower_components/topojson/topojson.js',
'bower_components/topojson/topojson.js',
'bower_components/d3/d3.js',
'bower_components/requirejs/requirejs.js'
]
我只需要将此代码添加到我的配置文件中
files:
...
modules: //this stops the wrapping
wrapper: false