[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

79 lines
2.1 KiB

import { Configuration } from 'webpack'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import c from './config/config.json'
const config: Configuration = {
mode: 'development',
devtool: 'eval-source-map',
entry: {
app: `${__dirname}/src/app.tsx`
},
output: {
path: `${__dirname}/dist`,
publicPath: '/',
filename: '[name].js',
},
optimization: {
splitChunks: {
chunks: 'all',
},
},
devServer: {
contentBase: `${__dirname}/dist`,
historyApiFallback: true,
before: app => {
app.get('/config.json', (req, res) => {
res.json(c)
})
},
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
alias: {
src: `${__dirname}/src`,
actions: `${__dirname}/src/actions/`,
components: `${__dirname}/src/components/`,
reducers: `${__dirname}/src/reducers/`,
selectors: `${__dirname}/src/selectors/`,
types: `${__dirname}/src/types/`,
}
},
module: {
rules: [
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: 'ts-loader',
},
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
{
loader: 'sass-loader',
options: {
sourceMap: true,
},
},
],
},
],
},
plugins: [
new HtmlWebpackPlugin({
title: 'Flexor',
hash: true,
template: 'src/index.ejs',
}),
new MiniCssExtractPlugin({
filename: '[name].css',
}),
// new BundleAnalyzerPlugin(),
],
}
export default config