mirror of
https://github.com/cupcakearmy/rauchmelder.git
synced 2024-12-22 16:16:28 +00:00
65 lines
1.6 KiB
JavaScript
Executable File
65 lines
1.6 KiB
JavaScript
Executable File
const path = require('path')
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
|
|
|
module.exports = {
|
|
entry: [
|
|
'./index.tsx'
|
|
],
|
|
output: {
|
|
filename: 'bundle.js',
|
|
path: path.resolve(__dirname, 'public')
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.jsx', '.ts', '.tsx']
|
|
},
|
|
context: path.resolve(__dirname, 'src'),
|
|
devServer: {
|
|
contentBase: path.resolve(__dirname, 'public/assets'),
|
|
open: true,
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: 'index.html'
|
|
}),
|
|
new MiniCssExtractPlugin({
|
|
filename: 'bundle.css'
|
|
})
|
|
],
|
|
stats: {
|
|
assets: true,
|
|
assetsSort: 'size',
|
|
all: false,
|
|
errors: true,
|
|
colors: true,
|
|
performance: true,
|
|
timings: true,
|
|
},
|
|
module: {
|
|
rules: [{
|
|
test: /\.tsx?$/,
|
|
loader: 'awesome-typescript-loader',
|
|
},
|
|
// {
|
|
// test: /\.html$/,
|
|
// use: ['html-loader']
|
|
// },
|
|
{
|
|
test: /\.css$/,
|
|
use: [MiniCssExtractPlugin.loader, 'css-loader']
|
|
}, {
|
|
test: /\.styl$/,
|
|
use: [MiniCssExtractPlugin.loader, 'css-loader', 'stylus-loader'],
|
|
}, {
|
|
test: /\.(jpg|png|gif|svg|woff2?|ttf|eot|svg|otf)$/,
|
|
use: [{
|
|
loader: 'file-loader',
|
|
options: {
|
|
name: '[name].[ext]',
|
|
outputPath: './assets/',
|
|
},
|
|
}],
|
|
}]
|
|
}
|
|
} |