Socket
Socket
Sign inDemoInstall

@roots/bud-swc

Package Overview
Dependencies
5
Maintainers
5
Versions
445
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@roots/bud-swc

SWC transpilation extension for Bud projects


Version published
Maintainers
5
Weekly downloads
2,529
decreased by-22.04%

Weekly downloads

Readme

Source

bud.js

MIT License npm Follow Roots

@roots/bud-swc

SWC transpilation extension for Bud projects


Installation

Install @roots/bud-swc to your project.

Yarn:

yarn add @roots/bud-swc --dev

npm:

npm install @roots/bud-swc --save-dev

Configuration

.swcrc

Including a .swcrc config file in the root of your project will replace all default options.

Be aware that extensions may still modify the options even if you use .swcrc. For example, @roots/bud-react will modify the jsc.transform option to support react refresh if bud.react.refresh is enabled.

API

You can modify swc options directly using bud.swc. These options are passed in more or less directly to swc-loader.

bud.swc.set(`jsc.parser.dynamicImport`, false);
bud.swc.setOptions((options) => ({
  ...options,
  jsc: {
    ...(options?.jsc ?? {}),
    parser: {
      ...(options?.jsc?.parser ?? {}),
      dynamicImports: false,
    },
  },
}));

Typechecking

@roots/bud-swc does not currently support typechecking during compilation as swc does not natively support it yet.

Our recommendation is to run typechecking as a separate process. You can use tsc directly: tsc --noEmit.

You could also add the fork-ts-webpack-plugin.

Subscribe to swc-project/swc#571 for more information on where swc-project is at with its typecheck implementation.

Contributing

Contributions are welcome from everyone.

We have contribution guidelines to help you get started.

License

@roots/bud-swc is licensed under MIT.

Community

Keep track of development and community news.

Sponsors

Bud is an open source project and completely free to use.

However, the amount of effort needed to maintain and develop new features and projects within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider sponsoring Roots.

KM Digital Carrot WordPress.com Pantheon Worksite Safety Copia Digital

Keywords

FAQs

Last updated on 09 Mar 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc