현재 gulp를 사용하여 npm으로 프로젝트를 설정했습니다.
node_modules-bootstrap-sass 및 jquery-folders가 들어있는 맵입니다.npm을 사용하여 부트 스트랩을 실행하지 못했습니다.
src-folder에서 dist-folder로 빌드합니다. dist-folder는 웹 브라우저에로드됩니다. 내가 jQuery를 실행 얻을 수없는 오전을 제외하고,
@import "../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap-sprockets";
@import "../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
모든 작업 (부트 스트랩 : 내 main.scss (SRC/스타일/main.scss)에서 등
스타일 나는 bootstrap.scss을 가져 NPM 부트 스트랩 --save
jQuery를 설치 NPM 설치와 설치 : 탐색 모바일 메뉴 또한 내가
부트 스트랩-말대꾸가 함께 설치된 bootstrap.js도로드되지 않는다는 것) 나는 그렇게 작동하지 않는 것 jquery - save
main.js 코드 (SRC/스크립트/main.js) :
$(document).ready(function() {
console.log('ready!');
});
콘솔 오류 :
Uncaught ReferenceError: $ is not defined
at main.js:3
그래서 나는 이미 검색과 main.js
내 주요
내에서 코드를 변경 .js 파일 코드 :var $ = require('jquery');
window.$ = $;
require('bootstrap-sass');
$(document).ready(function() {
console.log('ready!');
});
이제 브라우저 콘솔에서 다음 오류가 발생합니다.
이 똑같은 문제가 발생합니다. 솔루션을 찾을 수 있었습니까? – skipZero