All Projects → swc-project → swc-loader

swc-project / swc-loader

Licence: MIT License
Webpack plugin for swc

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Labels

Projects that are alternatives of or similar to swc-loader

register
Super fast alternative for babel-register
Stars: ✭ 38 (-84.49%)
Mutual labels:  swc
website
Documentation for the SWC project.
Stars: ✭ 53 (-78.37%)
Mutual labels:  swc
jest
Super-fast alternative for babel-jest or ts-jest without type checking
Stars: ✭ 472 (+92.65%)
Mutual labels:  swc
rollup-plugin-swc
Rollup plugin to compile bundles with the SWC.
Stars: ✭ 59 (-75.92%)
Mutual labels:  swc
react-ssr-starter
🔥 ⚛️ A React boilerplate for a universal web app with a highly scalable, offline-first foundation and our focus on performance and best practices.
Stars: ✭ 40 (-83.67%)
Mutual labels:  swc
nextjs-complete-boilerplate
Next js 12.3.1 boilerplate with Styled Components, Jest, React Testing Library, Prettier, ESLint, Plop JS and more 🚀
Stars: ✭ 50 (-79.59%)
Mutual labels:  swc
navis
Python 3 library for analysis of neuroanatomical data
Stars: ✭ 68 (-72.24%)
Mutual labels:  swc
dts2as
Convert TypeScript definitions (d.ts files) into ActionScript classes and interfaces for use as external libraries with Apache FlexJS
Stars: ✭ 37 (-84.9%)
Mutual labels:  swc
cli
CLI for swc
Stars: ✭ 87 (-64.49%)
Mutual labels:  swc
rc
Structured system configuration (I moved from NixOS to GuixSD)
Stars: ✭ 97 (-60.41%)
Mutual labels:  swc
Aleph.js
The Full-stack Framework in Deno.
Stars: ✭ 3,448 (+1307.35%)
Mutual labels:  swc
Swc
swc is a super-fast compiler written in rust; producing widely-supported javascript from modern standards and typescript.
Stars: ✭ 18,627 (+7502.86%)
Mutual labels:  swc

swc-loader

This package allows transpiling JavaScript files using swc and webpack.

Installation

npm i --save-dev @swc/core swc-loader webpack

Usage

module: {
    rules: [
        {
            test: /\.m?js$/,
            exclude: /(node_modules|bower_components)/,
            use: {
                // Use `.swcrc` to configure swc
                loader: "swc-loader"
            }
        }
    ];
}

You can pass options to the loader by using the option property.

module: {
    rules: [
        {
            test: /\.ts$/,
            exclude: /(node_modules|bower_components)/,
            use: {
                loader: "swc-loader",
                options: {
                    jsc: {
                        parser: {
                            syntax: "typescript"
                        }
                    }
                }
            }
        }
    ];
}

If you get an error while using swc-loader, you can pass sync: true to get correct error message.

module: {
    rules: [
        {
            test: /\.ts$/,
            exclude: /(node_modules|bower_components)/,
            use: {
                loader: "swc-loader",
                options: {
                    // This makes swc-loader invoke swc synchronously.
                    sync: true,
                    jsc: {
                        parser: {
                            syntax: "typescript"
                        }
                    }
                }
            }
        }
    ];
}

Configuration Reference

Refer https://swc.rs/docs/configuring-swc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].