빌드 후 변경된 파일 확인

웹팩 설정 중 output.filename 키 값에 치환값으로 contenthash 사용하게되면

파일 내용에 변경되지않는 이상, 고유한 해쉬값을 가지게 됩니다.

이를 통해 변경된 파일을 확인할 수 있습니다.

관련 설정 파일 위치

frontend/config/index.js

아래의 내용을 참고하여 수정하십시오.

const path = require('path');

module.exports = {
    common: {
        // webpack common config
        entry: { // entry
        bundle: path.resolve(__dirname, '../src/main.js'),
        },

        output: {
        // contextRoot
        publicPath: './',
        // 생성될 경로 기준
        path: path.resolve(__dirname, '../../assets/res/www'),
        // path: path.resolve(__dirname, '../dist'),
        // 생성될 js 파일명
        filename: 'js/[name].[contenthash].js',
        // chunk된 js 파일명
        chunkFilename: 'js/[name].[contenthash].js',
        },
        // 빌드시 사용될 css 파일명
        cssFile: 'css/[name].[contenthash].css',

        // 이미지 관련 파일 명
        imgFile: 'img/[name].[contenthash].[ext]',
        // base64변환 기준 byte
        imgLimit: 1,
        // 폰트 파일 명
        fontFile: 'font/[name].[contenthash].[ext]',
        // base64변환 기준 byte
        fontLimit: 1,

        alias: {
        // import시 단축하여 사용하고 싶은 경우
        'src': path.resolve(__dirname, '../src'),
        '@': path.resolve(__dirname, '../src/components'),
        },
    },
    dev: {
        // webpack dev config
        devtool: 'inline-source-map',
    },
    prod: {
        // webpack build config

    }
}