Webpack

    yarn serve , npm run serve 시의 URIError

    yarn serve 후 주어진 주소로 들어가면 터미널에 에러가 나타난다. URIError: Failed to decode param '/%3C%=%20BASE_URL%20%%3Efavicon.ico' 화면엔 아무것도 안나타난다. 원인: 루트 URL에 대해서 index.html을 찾고 있는데 빌드결과물에 index.html이 없다. (index.html은 없고 home.html을 포함 3개 html을 만들었음.) localhost:8080/home으로 접속했더니 화면을 확인할 수 있었다. 나머지도 마찬가지. 위 에러는 웹팩개발서버가 루트 URL에 대해서 디폴트로 index.html을 찾아서 발생하는 에러이다. 해결: vue.config.js에 devServer항목을 추가해준다. (웹팩서버를 devserve..

    npm run build 에러

    This relative module was not found: * ./src/main.js in multi ./src/main.js 해결: 웹팩 설정 문제였다. 웹팩빌드작업의 시작포인트가 디폴트로 main.js 가 잡혀있는데 나는 main.js를 다른 이름으로 수정해버렸다. 따라서 그 시작포인트도 수정된 곳으로 바꿔주어야하는 것이다. vue.config.js 에서 pages 속성으로 entry에 바꾼 main.js의 이름을 넣어주었다.

    [Django Tutorial] Blog 만들기 (11)

    Webpack 을 이용해 3개 페이지 만들기 (home.html, post_list.html, post_detail.html) 보통 webpack은 최종결과물로 1개의 html을 생성함. 예로 앞서 dist아래 1개의html을 생성했었다. 여러개 html을 생성하고 싶다면 vue.config.js 에서 pages라는 설정항목을 사용한다. 1 module.exports = { transpileDependencies: [ 'vuetify' ], outputDir: 'dist', publicPath: '/', assetsDir: 'static', pages: { home: { template: 'public/index.html', entry: 'src/pages/main_home.js', filename: '..