Cordova Webpack Transpiler Plugin
raw JSON → 0.3.1 verified Fri May 01 auth: no javascript deprecated
A Cordova plugin that automatically transpiles ES2015+/TypeScript and SCSS files, then bundles them with Webpack during the build process. Version 0.3.1 is the latest, but the project is experimental and has had no releases since 2018. It supports multiple transpiler configurations (Babel, TypeScript) and two project structures (sibling and external). Key differentiators include seamless integration with Cordova lifecycle hooks, automatic configuration file generation, and support for both Babel and TypeScript transpilers. However, it is no longer maintained and may have compatibility issues with modern Cordova versions.
Common errors
error Error: Cannot find module 'webpack' ↓
cause Webpack is not installed as a dependency.
fix
Run 'npm install webpack@1.x --save-dev' in the project root.
error Error: Plugin doesn't support this platform ↓
cause Unsupported platform (e.g., PhoneGap Build).
fix
Use Cordova CLI locally, not PhoneGap Build.
error TypeError: Cannot read property 'apply' of undefined ↓
cause Missing or incompatible webpack configuration.
fix
Check webpack.config.js and webpack.common.js exist and are valid.
error Error: The 'prepare' phase has already been executed, results may be incorrect ↓
cause Plugin was auto-added during prepare/build.
fix
Re-run your previous cordova command after plugin installation.
Warnings
gotcha Plugin is experimental and described as 'might blow your installation away' by the author. ↓
fix Review scripts folder before installing and ensure you trust the code.
breaking Node >= 5.0.0 required; may not work with modern Node versions due to outdated dependencies. ↓
fix Use Node 5.x or later, but consider migrating to a maintained alternative.
gotcha Configuration files (webpack.config.js) will not be overwritten if they already exist, leading to potential inconsistencies. ↓
fix Remove existing config files before adding/reconfiguring plugin.
gotcha If plugin is discovered missing during prepare/build, the prepare phase yields incorrect results; must re-run the previous command. ↓
fix Always run the command again if plugin was auto-added during build.
gotcha Transpiler configuration cannot be changed on-the-fly; must remove plugin and leftover files first. ↓
fix Remove plugin, delete webpack.config.js, webpack.common.js, tsconfig.json, .babelrc, and node_modules, then re-add with new config variable.
deprecated Plugin has not been updated since 2018; dependencies like webpack 1.x are severely outdated. ↓
fix Use a modern alternative like cordova-plugin-webpack or manual webpack integration.
Install
npm install cordova-plugin-webpack-transpiler yarn add cordova-plugin-webpack-transpiler pnpm add cordova-plugin-webpack-transpiler Quickstart