soundcraft-rak/webpack.config.js

40 lines
851 B
JavaScript
Raw Normal View History

2021-06-01 11:18:17 +00:00
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
2021-06-02 12:35:59 +00:00
module.exports = (env, options) => ({
2021-06-01 11:18:17 +00:00
entry: './src/index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
2021-06-02 12:35:59 +00:00
{
test: /\.(woff|woff2|png|jpg)$/,
use: {
loader: 'file-loader',
},
},
2021-06-01 11:18:17 +00:00
],
},
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'
}),
],
2021-06-02 12:35:59 +00:00
devtool: options.mode != 'production' ? 'eval-source-map' : 'hidden-source-map',
});