Post

Jekyll 테마 적용 시, *min.js 파일 못찾을 경우

Jekyll 테마 적용하고 git push를 했더니 다음과 같은 문제가 발생했다.

img01

문제 발생 부분

1
2
3
4
5
6
7
8
9
10
11
12
13
...
* At _site/404.html:1:
  internal script reference /assets/js/dist/page.min.js does not exist
...
* At _site/archives/index.html:1:
  internal script reference /assets/js/dist/misc.min.js does not exist
...
* At _site/categories/index.html:1:
  internal script reference /assets/js/dist/categories.min.js does not exist
...
* At _site/index.html:1:
  internal script reference /assets/js/dist/home.min.js does not exist
...

*min.js 파일을 못찾는다.

문제 원인

node.js 모듈을 설치하고 initial과 build를 하지 않으면 발생하는 에러이다.

해결 방법

  • 먼저 node.js를 설치(https://nodejs.org/en/download)한 후, npm을 이용해 initial과 build를 해준다 (github.io 위치에서 실행해준다.)
1
2
% npm install
% npm run build

위의 명령어들을 순차적으로 진행해주면 다음과 같이 *min.js 파일들이 생성이 된 것을 확인 할 수 있다.

img02

  • 이때, .gitignore 파일을 열어 assets/js/dist주석 처리해야 한다.
    (.gitignore은 숨겨진 파일로 Mac일 경우, command + shift + . 를 함께 눌러주면 화면에 노출된다.)

img03

이렇게 하면 해당 부분 에러가 해결된다.

This post is licensed under CC BY 4.0 by the author.