50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
/*
|
|
* Copyright (c) 2020. Pascal Syma <pascal@syma.dev>.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
const webpack = require("webpack");
|
|
const path = require("path");
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
const {CleanWebpackPlugin} = require("clean-webpack-plugin");
|
|
|
|
module.exports = {
|
|
mode: "development",
|
|
devtool: "eval-source-map",
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: "babel-loader"
|
|
}
|
|
},
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: 'ts-loader',
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
test: /\.(ogg|mp3|wav|mpe?g|gif|png|jpe?g|svg|xml)$/i,
|
|
use: "file-loader"
|
|
},
|
|
{
|
|
test: /\.csv$/i,
|
|
use: 'raw-loader',
|
|
},
|
|
]
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
},
|
|
plugins: [
|
|
new CleanWebpackPlugin({
|
|
root: path.resolve(__dirname, "../")
|
|
}),
|
|
new HtmlWebpackPlugin({
|
|
template: "./index.html"
|
|
})
|
|
]
|
|
};
|