webpack-base/webpack.config.js
Michael Peters 513c352cab fix sass css
2023-01-09 15:01:06 -08:00

29 lines
808 B
JavaScript

const path = require('path');
module.exports = {
entry: path.resolve(__dirname, 'src', 'index.js'),
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
// sass support with `import './styles.scss'`
{
test: /\.s[ac]ss$/i,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
// css support with `import './styles.css'`
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
// image support with `import Image from './image.png'`
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
},
],
},
};