This repository has been archived on 2024-06-14. You can view files and clone it, but cannot push or open issues or pull requests.
icynet-auth-server/webpack.config.js

39 lines
958 B
JavaScript
Raw Normal View History

/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: ['./src/fe/ts/index.ts', './src/fe/scss/index.scss'],
plugins: [
new MiniCssExtractPlugin({
filename: '../css/index.css',
}),
],
module: {
rules: [
{
test: /\.(ts|js)?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-typescript'],
},
},
},
{
test: /\.(css|scss)/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
path: path.resolve(__dirname, 'public', 'js'),
filename: 'app.bundle.js',
},
devtool: process.env.NODE_ENV !== 'production' ? 'source-map' : undefined,
};