그래서이 방법을 알아 내려고 노력하고 있습니까? bower를 통해 bootstrap-sass를 다운로드하고 bootstrap javascript를 shim에 추가했습니다.bootstrap.js를 추가하여 browserify 하시겠습니까?
나를 혼란스럽게하는 몇 가지 사항이 있는데, bootstrap.js 파일은 다음과 같습니다.
//= require bootstrap/affix
//= require bootstrap/alert
//= require bootstrap/button
//= require bootstrap/carousel
//= require bootstrap/collapse
//= require bootstrap/dropdown
//= require bootstrap/tab
//= require bootstrap/transition
//= require bootstrap/scrollspy
//= require bootstrap/modal
//= require bootstrap/tooltip
//= require bootstrap/popover
이것은 일종의 설명이지만 동시에 여전히 혼란 스럽다. 부트 스트랩 shim에 추가 할 때 bootstrap.js 파일 만 포함 시키거나 필요한 모든 파일에 연결해야합니까?
해킹을 피하기 위해 (그 동안 내가하고있을 것입니다) bootstrap.js를 browserify에 포함시키는 방법에 대한 정보를 얻으려고합니다.
편집 : 내가 필요한 모든 파일을 연결하고 스크립트를 포함시켜야 할 것 같아.
내가 코멘트없이 노력하겠습니다, 그럼 그게 내가 하나 개의 파일에 모든 스크립트를 CONCAT 무슨 일이 일어 :) 볼 수 있습니다 실패 할 경우
편집 : 흠이 CONCAT 이론 작품처럼 보인다! 유일한 것은 jQuery입니다. 한번보세요.
; jQuery = global.jQuery = require("c:\\wamp\\www\\mysite\\app\\client\\requires\\jquery\\js\\jquery.js");
/* ========================================================================
* Bootstrap: affix.js v3.1.1
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
이 내 컴파일 browserify 코드, 내가 수동으로 jQuery
$
에 이상을 변경해야 내가 부트 스트랩 기능은 예를 $('body').modal('toggle')
말할 호출 할 때이 작업을 얻을 수있는 유일한 방법.
내 심 안에 두 가지를 모두 사용해 보았지만 똑같은 것을 수동으로 작성해야합니다. $
. 예
// Notice I use $ here not jQuery like above, this is the only way to get it to work!
; $ = global.jQuery = require("c:\\wamp\\www\\mysite\\app\\client\\requires\\jquery\\js\\jquery.js");
/* ========================================================================
* Bootstrap: affix.js v3.1.1
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
그래, 브라우저 화가 정말 실망 스럽지만 의심 스러울 때는 심과 바이올린을 깨달았습니다. –
답을주고 올바른 해결책을 제시하기 위해서 내가 가지고 있었음에도 불구하고 ... –
고마워, 관대했다. – Trott