soundcraft-rak/webpack.config.js
2021-06-02 15:35:59 +03:00

40 lines
851 B
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = (env, options) => ({
entry: './src/index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(woff|woff2|png|jpg)$/,
use: {
loader: 'file-loader',
},
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'app.bundle.js',
path: path.resolve(__dirname, 'public'),
},
plugins: [
new HtmlWebpackPlugin({
title: 'soundcraft ui',
template: 'src/index.html'
}),
],
devtool: options.mode != 'production' ? 'eval-source-map' : 'hidden-source-map',
});