39 lines
958 B
JavaScript
39 lines
958 B
JavaScript
|
/* 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,
|
||
|
};
|