msgba-web/webpack.config.js

39 lines
932 B
JavaScript
Raw Permalink Normal View History

const path = require('path')
2023-03-19 20:05:33 +01:00
module.exports = {
2023-03-22 13:53:16 +01:00
entry: './js-src/index.tsx',
2023-03-19 20:05:33 +01:00
mode: 'development',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'public/js/')
2023-03-19 20:05:33 +01:00
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
2023-03-19 20:05:33 +01:00
roots: [
path.resolve(__dirname, 'js-src/')
],
alias: {
'@msgba': path.resolve(__dirname, 'js-src')
}
2023-03-19 20:05:33 +01:00
},
module: {
rules: [
2023-03-22 13:53:16 +01:00
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
2023-03-22 13:53:16 +01:00
},
2023-03-19 20:05:33 +01:00
{
test: /\.jpe?g|png$/,
exclude: /node_modules/,
use: ['url-loader', 'file-loader']
2023-03-19 20:05:33 +01:00
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader'
2023-03-19 20:05:33 +01:00
}
]
}
}