spiffworkflow-frontend/craco.config.js

58 lines
1.4 KiB
JavaScript
Raw Normal View History

module.exports = {
2022-06-15 17:52:00 +00:00
module: {
rules: [
{
test: /\.m?[jt]sx?$/,
2022-06-15 17:52:00 +00:00
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
plugins: [
[
'@babel/plugin-transform-react-jsx',
{
pragma: 'h',
pragmaFrag: 'Fragment',
},
],
'@babel/preset-react',
'@babel/plugin-transform-typescript',
{
importSource: '@bpmn-io/properties-panel/preact',
runtime: 'automatic',
},
],
},
},
2022-06-15 17:52:00 +00:00
},
],
2022-06-15 17:52:00 +00:00
},
webpack: {
configure: {
resolve: {
alias: {
inferno:
process.env.NODE_ENV !== 'production'
? 'inferno/dist/index.dev.esm.js'
: 'inferno/dist/index.esm.js',
react: 'preact/compat',
'react-dom/test-utils': 'preact/test-utils',
'react-dom': 'preact/compat', // Must be below test-utils
'react/jsx-runtime': 'preact/jsx-runtime',
2022-06-15 17:52:00 +00:00
},
},
},
2022-06-15 17:52:00 +00:00
},
babel: {
presets: [
'@babel/preset-env',
['@babel/preset-react', { runtime: 'automatic' }],
'@babel/preset-typescript',
],
2022-06-15 17:52:00 +00:00
// plugins: [],
loaderOptions: (babelLoaderOptions) => {
2022-06-15 17:52:00 +00:00
return babelLoaderOptions;
},
},
};