
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@imtf/craco-esbuild
Advanced tools
Use [esbuild](https://github.com/evanw/esbuild) in your [create-react-app](https://create-react-app.dev/) with [craco](https://github.com/gsoft-inc/craco) for faster compilation, development and tests.
Use esbuild in your create-react-app with craco for faster compilation, development and tests.
Run the following command to install craco-esbuild in your project:
yarn add --dev craco-esbuild @craco/craco
# OR
npm install --save-dev craco-esbuild @craco/craco
Add this configuration to your craco.config.js configuration file:
// craco.config.js
const CracoEsbuildPlugin = require('craco-esbuild');
module.exports = {
plugins: [{ plugin: CracoEsbuildPlugin }],
};
To use craco instead of react-scripts to manage our application, edit the scripts section of your package.json.
/* package.json */
"scripts": {
- "start": "react-scripts start",
+ "start": "craco start",
- "build": "react-scripts build",
+ "build": "craco build"
- "test": "react-scripts test",
+ "test": "craco test"
}
You can configure the options of the plugin by passing an options object.
esbuildLoaderOptions: customise the options passed down to the esbuild loader. Note: This will be used only by webpackesbuildMinimizerOptions: customise the options passed down to ESBuildMinifyPlugin. Note: This will be used only by webpackincludePaths: include external directories in loader.enableSvgr: enable the svgr webpack plugin. SVGs are loaded as separate files by default. Enabling this options allow you to import SVGs as React components. See CRA documentation for more detailed explanation.skipEsbuildJest: Avoid using esbuild-jest for jest configuration. Could be useful to avoid compatibility issues with transpiling tests.esbuildJestOptions: customise the options passed down to the esbuild-jest transformer.For example add this configuration to your craco.config.js configuration file:
// craco.config.js
const CracoEsbuildPlugin = require('craco-esbuild');
module.exports = {
plugins: [
{
plugin: CracoEsbuildPlugin,
options: {
includePaths: ['/external/dir/with/components'], // Optional. If you want to include components which are not in src folder
enableSvgr: true, // Optional.
esbuildLoaderOptions: {
// Optional. Defaults to auto-detect loader.
loader: 'jsx', // Set the value to 'tsx' if you use typescript
target: 'es2015',
},
esbuildMinimizerOptions: {
// Optional. Defaults to:
target: 'es2015',
css: true, // if true, OptimizeCssAssetsWebpackPlugin will also be replaced by esbuild.
},
skipEsbuildJest: false, // Optional. Set to true if you want to use babel for jest tests,
esbuildJestOptions: {
loaders: {
'.ts': 'ts',
'.tsx': 'tsx',
},
},
},
},
],
};
MIT © Léo Pradel
FAQs
Use [esbuild](https://github.com/evanw/esbuild) in your [create-react-app](https://create-react-app.dev/) with [craco](https://github.com/gsoft-inc/craco) for faster compilation, development and tests.
The npm package @imtf/craco-esbuild receives a total of 0 weekly downloads. As such, @imtf/craco-esbuild popularity was classified as not popular.
We found that @imtf/craco-esbuild demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.