mirror of
https://github.com/streamwall/streamwall.git
synced 2025-12-06 01:45:37 -05:00
60 lines
1.4 KiB
JavaScript
60 lines
1.4 KiB
JavaScript
module.exports = ({ babel }) => ({
|
|
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
|
|
devtool: process.env.NODE_ENV === 'production' ? 'source-map' : 'eval-source-map',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(js|ts|jsx|tsx)$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: babel,
|
|
},
|
|
},
|
|
{
|
|
test: /\.css$/i,
|
|
use: ['style-loader', 'css-loader'],
|
|
},
|
|
{
|
|
test: /\.(png|jpg|jpeg|gif|ico|ttf)$/,
|
|
type: 'asset/resource',
|
|
},
|
|
{
|
|
test: /\.svg$/,
|
|
loader: '@svgr/webpack',
|
|
options: {
|
|
replaceAttrValues: {
|
|
'#333': 'currentColor',
|
|
'#555': '{props.color}',
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.jsx', '.js', '.ts', '.tsx'],
|
|
alias: {
|
|
react: 'preact/compat',
|
|
'react-dom': 'preact/compat',
|
|
},
|
|
modules: ['node_modules', 'src'],
|
|
fallback: {
|
|
path: require.resolve('path-browserify'),
|
|
url: require.resolve("url/"),
|
|
crypto: require.resolve("crypto-browserify"),
|
|
https: require.resolve("https-browserify"),
|
|
http: require.resolve("stream-http")
|
|
}
|
|
},
|
|
stats: {
|
|
colors: true,
|
|
modules: true,
|
|
reasons: true,
|
|
errorDetails: true,
|
|
warnings: true,
|
|
},
|
|
cache: {
|
|
type: 'filesystem',
|
|
},
|
|
})
|