{"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,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","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,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}