CUDS_2) SCSS, PNG Error in Webpack

< LInk >
https://www.youtube.com/watch?v=CzLiXgRUt4g

< Solution Code >

const path = require('path');
const webpack = require('webpack');

module.exports = {
    mode: 'development', // production
    devtool: 'eval', // hidden-source-map
    resolve: {
        extensions: ['.jsx', '.js', '.tsx', '.ts', '.scss'],
    },

    entry: {
        app: './client'
    },
    module: {
        rules: [
                {
                    test: /\.tsx?$/ ,
                    loader: 'awesome-typescript-loader',
                },
                {
                    test: /\.scss$/ ,
                    use: [
                        'style-loader', // 3. inject style into dom
                        'css-loader',  // 2. Turns css into common.js
                        'sass-loader' // 1. Turns sass into css
                    ]
                },
                {
                    test : /\.(jpg|png)$/,
                    use : [
                        {
                            loader  : 'file-loader',
                            options : {
                                name : '[name].[ext]' ,
                                esModule: false,
                            }
                        }
                    ]
                }
        ]
    },
    plugins: [
        
    ],
    output: {
        filename: 'app.js',
        path: path.join(__dirname, 'dist'),
        publicPath: '/dist/',
    }
}

좋은 웹페이지 즐겨찾기