51 lines
1.2 KiB
JavaScript
51 lines
1.2 KiB
JavaScript
/* eslint-disable */
|
|
const path = require('path');
|
|
const HtmlPlugin = require('html-webpack-plugin');
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
|
|
module.exports = {
|
|
entry: path.resolve(__dirname, '..', 'src', 'index.js'),
|
|
resolve: {
|
|
extensions: ['.ts', '.tsx', '.js', '.jsx', '.css', '.scss'],
|
|
},
|
|
output: {
|
|
path: path.join(__dirname, '..', '/dist'),
|
|
filename: '[name].[contenthash].js',
|
|
publicPath: '/',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(ts|tsx)$/,
|
|
use: ['ts-loader'],
|
|
},
|
|
{
|
|
test: /\.(js|jsx)$/,
|
|
exclude: /nodeModules/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
},
|
|
},
|
|
{
|
|
test: /\.((c|sa|sc)ss)$/i,
|
|
use: ['style-loader', 'css-loader', 'sass-loader', 'postcss-loader'],
|
|
},
|
|
{
|
|
test: /\.(?:ico|gif|png|jpg|jpeg)$/i,
|
|
type: 'asset/resource',
|
|
},
|
|
{
|
|
test: /\.(woff(2)?|eot|ttf|otf|svg|)$/,
|
|
type: 'asset/inline',
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new HtmlPlugin({
|
|
template: './index.html',
|
|
favicon: './src/favicon.svg',
|
|
}),
|
|
new CopyPlugin({ patterns: [{ from: './config.js' }] }),
|
|
],
|
|
};
|