{"id":25228,"library":"enb-transpiler","title":"enb-transpiler","description":"An ENB tech that transpiles JavaScript files with ES6+ syntax to ES5 using Babel. Current stable version 0.1.2. Designed for the ENB build system, it processes files through a user-defined chain of transformations, including Babel transpilation and custom code wrapping. Differentiators: tight integration with ENB and BEM technologies, supports per-target configuration with source suffixes and chain modifiers. Released as an npm package with MIT license, maintained by b0rey. Minimal release cadence; last update in 2018.","status":"maintenance","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/b0rey/enb-transpiler","tags":["javascript","enb","babel","transpiler"],"install":[{"cmd":"npm install enb-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add enb-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add enb-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Build system; runtime peer dependency","package":"enb","optional":false},{"reason":"Transpilation engine; used under the hood","package":"babel-core","optional":false}],"imports":[{"note":"Package is CommonJS only; ESM import will fail.","wrong":"import transpiler from 'enb-transpiler'","symbol":"transpiler","correct":"const transpiler = require('enb-transpiler')"},{"note":"The module is a standalone tech, not part of enb core.","wrong":"require('enb/techs/transpiler')","symbol":"enb-transpiler","correct":"require('enb-transpiler')"},{"note":"Package does not ship TypeScript types.","wrong":"","symbol":"enb-transpiler (type import)","correct":"// no type definitions; use @types/enb-transpiler if needed"}],"quickstart":{"code":"const transpiler = require('enb-transpiler');\nconst FileProvideTech = require('enb/techs/file-provider');\nconst bemTechs = require('enb-bem-techs');\n\nmodule.exports = function(config) {\n  config.node('bundle', function(node) {\n    node.addTechs([\n      [FileProvideTech, { target: '?.bemdecl.js' }],\n      [bemTechs.levels, { levels: ['blocks'] }],\n      [bemTechs.deps],\n      [bemTechs.files]\n    ]);\n\n    node.addTech([transpiler, {\n      target: '?.worker.js',\n      sourceSuffixes: ['vanilla.js', 'worker.js'],\n      chain: [\n        'const global = { document: { createElement: () => ({}) } }',\n        'ym',\n        'const modules = global.modules',\n        `self.APP_VERSION = '1.0.0'`,\n        'source'\n      ],\n      params: { presets: ['env'] }\n    }]);\n\n    node.addTarget('?.worker.js');\n  });\n};","lang":"javascript","description":"Configures an ENB node to transpile vanilla.js and worker.js files using Babel with env preset, adding global and ym stubs."},"warnings":[{"fix":"Replace 'options' with 'params' in tech configuration.","message":"Version 0.1.2 removed the 'options' parameter; use 'params' instead.","severity":"breaking","affected_versions":">=0.1.2"},{"fix":"Install 'babel-core@7' and set 'params' to use Babel 7 presets/plugins.","message":"Babel 6 is used internally; upgrade to Babel 7 by installing babel-core@^7 and providing custom params.","severity":"deprecated","affected_versions":">=0"},{"fix":"Ensure the chain array ends with 'source'.","message":"Chain order matters: 'source' must be last to include original code; otherwise empty output.","severity":"gotcha","affected_versions":">=0"},{"fix":"Always specify 'sourceSuffixes' matching your file extensions.","message":"If 'sourceSuffixes' is omitted, the tech processes no files and outputs empty target.","severity":"gotcha","affected_versions":">=0"},{"fix":"Use alternative ENB techs if sourcemaps are required.","message":"The transplier tech does not support sourcemaps; errors will point to the bundle, not original files.","severity":"gotcha","affected_versions":">=0"}],"env_vars":null,"search_vec":"'0.1.2':21 '2018':82 'b0rey':75 'babel':17,40,85 'bem':52 'build':26 'cadenc':78 'chain':36,63 'code':44 'configur':58 'current':18 'custom':43 'defin':35 'design':22 'differenti':46 'enb':2,5,25,50,84 'enb-transpil':1 'es5':15 'es6':12 'file':10,30 'includ':39 'integr':48 'javascript':9,83 'last':79 'licens':72 'maintain':73 'minim':76 'mit':71 'modifi':64 'npm':68 'packag':69 'per':56 'per-target':55 'process':29 'releas':65,77 'sourc':60 'stabl':19 'suffix':61 'support':54 'syntax':13 'system':27 'target':57 'tech':6 'technolog':53 'tight':47 'transform':38 'transpil':3,8,41,86 'updat':80 'use':16 'user':34 'user-defin':33 'version':20 'wrap':45","created_at":"2026-05-01T13:43:40.700449+00:00","updated_at":"2026-05-01T13:43:40.700449+00:00","problems":[{"fix":"npm install --save-dev babel-core","cause":"babel-core is not installed or version mismatch.","error":"Error: Cannot find module 'babel-core'"},{"fix":"Replace with object: { presets: ['env'] }","cause":"Using 'techs.babel' which is undefined; Babel options must be provided as plain object.","error":"TypeError: techs.babel is not a function"},{"fix":"Add 'node.addTarget('?.worker.js')' after the addTech call.","cause":"Missing node.addTarget('?.worker.js') after tech.","error":"Error: Target '?.worker.js' not found in node's targets"},{"fix":"Ensure chain array ends with 'source'.","cause":"Incorrect chain order without ending with 'source'.","error":"Error: 'source' must be last in chain"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/b0rey/enb-transpiler","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/enb-transpiler","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}