ionian/webpack.config.js

37 lines
909 B
JavaScript

const path = require("path");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = ()=>{return {
entry: './src/client/app.tsx',
output: {
path: path.resolve(__dirname, 'dist/js'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.(js|ts|tsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
}
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader,'css-loader']
}
]
},
plugins : [
new MiniCssExtractPlugin({
"filename":'../css/style.css'}),
],
devtool: 'source-map',
resolve: {
extensions: ['.js','.css','.ts','.tsx']
},
devServer: {
historyApiFallback: true,
port: 3001
}
};}