Sco*_*y H 11 javascript git git-submodules brunch
我们希望在多个项目中使用相同的构建系统.我有一个工作早午餐配置文件,我想放在一个git子模块中,以便可以在多个项目中引用该子模块,并且更改很容易传播(比复制和粘贴更不易碎,并设置brunch-config.js的权威来源) .
将brunch-config.js放在git子模块中会导致我的文件夹结构如下所示:
WebApp // git root
|---Brunch-Build-System // git submodule
| |---brunch-config.js
|---node_modules
|---source // all the source code I want compiled
Run Code Online (Sandbox Code Playgroud)
早午餐运行假设brunch-config.js将与正在编译的源相同或更高.在此设置中,情况并非如此.我已经尝试修改我的brunch-config.js使用相对路径无济于事.这是我files目前的Brunch配置块,没有任何相对路径尝试:
files: {
javascripts: {
joinTo: {
'js/lib.js': /^(?!source\/)/
},
entryPoints: {
'source/scripts/app.jsx': {
'js/app.js': /^source\//
},
}
},
stylesheets: {joinTo: 'css/core.css'}
}
Run Code Online (Sandbox Code Playgroud)
如果上面给出了所需的文件夹结构,我如何修改它以使用相对路径?这甚至可能吗?
子模块需要与父存储库中的根文件夹关联:它是gitlink(主存储库索引中的一个特殊条目),记录了该子模块签出的 SHA1。
在您的情况下,最好可以在post-checkout hook中使用一个脚本,确保以下内容之间存在符号链接:
brunch-config.js在正确的位置并且Brunch-Build-System / brunch-config.js子模块的钩子中包含的线条将类似于
#!/bin/bash
if [ ! -e /correct/path/for/brunch-config.js ]; then
ln -s /correct/path/for/brunch-config.js Brunch-Build-System/brunch-config.js
fi
Run Code Online (Sandbox Code Playgroud)
虽然 OP 在 Windows 上:
我最终只是以编程方式复制文件并 gitignoreing 复制的文件
| 归档时间: |
|
| 查看次数: |
524 次 |
| 最近记录: |