Skip to content
Snippets Groups Projects
webpack.base.config.js 1.5 KiB
Newer Older
  • Learn to ignore specific revisions
  • Todd Dembrey's avatar
    Todd Dembrey committed
    
    module.exports = {
        context: __dirname,
    
    
    Todd Dembrey's avatar
    Todd Dembrey committed
        entry: ['./src/index'],
    
    Todd Dembrey's avatar
    Todd Dembrey committed
    
        output: {
    
    Todd Dembrey's avatar
    Todd Dembrey committed
        },
    
        plugins: [
        ], // add all common plugins here
    
        module: {
            rules: [
                {
                    test: /\.jsx?$/,
                    loader: 'babel-loader',
    
    Todd Dembrey's avatar
    Todd Dembrey committed
                    include: [path.resolve(__dirname, './src')],
    
    Todd Dembrey's avatar
    Todd Dembrey committed
                    query: {
    
    Todd Dembrey's avatar
    Todd Dembrey committed
                        presets: ['@babel/preset-react'],
                        plugins: [
                            'react-hot-loader/babel',
                            '@babel/plugin-proposal-class-properties'
                        ]
    
    Todd Dembrey's avatar
    Todd Dembrey committed
                    }
    
                },
                {
                    test: /\.scss$/,
    
                    use: [{
                        loader: 'style-loader'
                    }, {
                        loader: 'css-loader',
                        options: {
                            sourceMap: true
                        }
                    }, {
                        loader: 'sass-loader',
                        options: {
                            sourceMap: true,
                            data: '@import "main.scss";',
                            includePaths: [
                                path.join(__dirname, 'src')
                            ]
                        }
                    }]
    
                },
                {
                    test: /\.svg$/,
                    use: ['@svgr/webpack']
    
    Todd Dembrey's avatar
    Todd Dembrey committed
                }
            ]
        },
    
        resolve: {
    
            modules: ['node_modules', './src'],
    
    Todd Dembrey's avatar
    Todd Dembrey committed
            extensions: ['.js', '.jsx']