• Skip to main content
  • Skip to primary sidebar

Web Development Archive

  • Archive
You are here: Home / Archives for esbuild

esbuild

ESBuild – JS

npm install esbuild esbuild-sass-plugin --save-dev
npm install @wordpress/blocks @wordpress/element

package.json

{
"name": "twentyfive-child",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "node build.js",
"start": "node build.js --watch",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"esbuild": "^0.24.2",
"esbuild-sass-plugin": "^3.3.1"
},
"dependencies": {
"@wordpress/blocks": "^14.3.0",
"@wordpress/element": "^6.14.0"
}
}

build.js

const esbuild = require('esbuild');

(async () => {
const ctx = await esbuild.context({
entryPoints: ['src/index.js'],
bundle: true,
minify: true,
sourcemap: false,
outfile: 'dist/bundle.js',
target: ['es2015'],
loader: { '.js': 'jsx' },
});

await ctx.watch();
console.log('Watching for changes...');
})();

Filed Under: JavaScript Tagged With: esbuild

Primary Sidebar

  • angular.io
© 2026 WP Flames - All Right Reserved