36 lines
884 B
JavaScript
36 lines
884 B
JavaScript
|
const path = require("path");
|
||
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||
|
|
||
|
module.exports = ()=>{return {
|
||
|
entry: './src/client/js/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'})
|
||
|
],
|
||
|
resolve: {
|
||
|
extensions: ['.js','.css','.ts','.tsx']
|
||
|
},
|
||
|
devServer: {
|
||
|
historyApiFallback: true,
|
||
|
port: 3001
|
||
|
}
|
||
|
};}
|