nuxt-esbuild

Nuxt ESBuild module
5,804 67
Install
npm install nuxt-esbuild
Latest Version:1.1.0
License:MIT
Last Updated:May 22, 2021
Links: GitHub  ·  npm
Maintainer: galvez

Nuxt ESBuild module

Enables esbuild-loader to transpile JavaScript and TypeScript in Nuxt.

Use cases:

  • If you don't use TypeScript, it's only enabled for dev, so dev build times are faster. It will be disabled when building for production and only pass through Babel then. It doesn't make sense to run both esbuild-loader and babel-loader in this case because the speed gain offered by esbuild doesn't compensate well for the cost of running the entire source through Babel afterwards for targeting older browsers.

  • If you do use TypeScript, it'll use esbuild to quickly transpile TypeScript and additionally still do a final pass with the original Babel settings for production. In this case it's doing two transpilations, the difference being it uses esbuild-loader instead of the official ts-loader, and, in this case, the speed gain is worthwhile.

This is similar to Vite's approach.

Install

npm i nuxt-esbuild --save

In nuxt.config.js:

buildModules: [
  'nuxt-esbuild'
]

Enabling TypeScript

In nuxt.config.js:

modules: [
  'nuxt-esbuild'
],
esbuild: {
  loader: 'ts',
  // Optional
  tsconfig: 'path-to-tsconfig.json',
},

Notice

Follow the esbuild project for latest info on its reliability and options.

Related Packages

comfortable-nuxt

Nuxt Module of the Comfortable Javascript - SDK

1,599 0
vue2-map-chart

VueJS Map Chart

1,013 0
@nuxtjs/composition-api

Composition API hooks for Nuxt

1,254,832 702
vue-use-state-effect

Fast and small library built on top of the native Vue.js API, providing a safe a...

13,117 38
vue-sanity

Sanity integration for Vue

6,530 62

Version History

Version Released License
1.1.0 MIT
1.0.2 MIT
1.0.1 MIT
1.0.0 MIT
0.0.9 MIT