Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
build.onResolve({ filter: /^react$/ }, args => {
return {
path: require.resolve('preact/compat'),
external: false,
}
});
build.onResolve({ filter: /^react-dom$/ }, args => {
return {
path: require.resolve('preact/compat'),
external: false,
}
});
},
}
esbuild.serve({
servedir: 'public',
port: config.internalPort,
}, {
entryPoints: ['src/main.js'],
bundle: true,
sourcemap: true,
sourcesContent: true,
target: [
'es2015',
],
outfile: 'public/js/main.js',
loader: {
'.js': 'jsx',
},
jsxFactory: 'h',
jsxFragment: 'Fragment',