2024-01-16 00:28:20 -06:00
|
|
|
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
|
|
|
|
|
|
|
|
const plugins = [];
|
|
|
|
|
|
|
|
const {
|
|
|
|
FLECKS_CORE_IS_PRODUCTION,
|
|
|
|
} = process.env;
|
|
|
|
|
|
|
|
if ('true' !== FLECKS_CORE_IS_PRODUCTION) {
|
|
|
|
plugins.push('react-refresh/babel');
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.dependencies = ['@flecks/web'];
|
|
|
|
|
|
|
|
exports.hooks = {
|
|
|
|
'@flecks/core.babel': () => ({
|
|
|
|
plugins,
|
|
|
|
presets: [
|
|
|
|
'@babel/preset-react',
|
|
|
|
],
|
|
|
|
}),
|
2024-01-22 09:16:07 -06:00
|
|
|
'@flecks/build.config': (target, config, env, argv) => {
|
2024-01-16 00:28:20 -06:00
|
|
|
const isProduction = 'production' === argv.mode;
|
|
|
|
if (!isProduction) {
|
|
|
|
config.plugins.push(new ReactRefreshWebpackPlugin());
|
|
|
|
}
|
|
|
|
},
|
2024-01-22 09:16:07 -06:00
|
|
|
'@flecks/build.extensions': () => ['.jsx'],
|
2024-01-16 00:28:20 -06:00
|
|
|
};
|