Registry / web-framework / vue-template-es2015-compiler

vue-template-es2015-compiler

JSON →
library1.9.1jsnpmunverified

This package is an internal build-time utility primarily used by `vue-loader` and `vueify` in Vue 2 projects. Its main function is to post-process raw render functions generated by `vue-template-compiler` to introduce support for ES2015+ features within template expressions, leveraging a custom fork of Buble. Additionally, it removes the `with` block from render functions to ensure strict-mode compliance. The current stable version is 1.9.1, but the package has not seen updates since February 2019, indicating it is no longer actively maintained for modern Vue development. It is a critical component for enabling advanced JavaScript syntax in Vue 2 templates during the build process, distinguishing itself by its specific focus on ES2015+ transpilation and strict-mode compatibility for Vue 2's compilation output.

npm install vue-template-es2015-compiler
INSTALL
IMPORT
SIG · VUE-TEMPLATE-ES201
V
vue-template-es2015-compiler
web-frameworkjavascriptv1.9.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compile
✓ import compile from 'vue-template-es2015-compiler'
✗ const { compile } = require('vue-template-es2015-compiler')
This package typically exposes a default export for its primary compilation function. Direct import by end-users is uncommon as it's an internal tool.
processRenderFunction
✓ const processRenderFunction = require('vue-template-es2015-compiler');
CommonJS `require` for its main function, likely named 'processRenderFunction' or similar in internal contexts. The package's `main` entry is `index.js`.

Demonstrates programmatic usage of the compiler to process a raw Vue render function string, transpiling ES2015+ features and removing `with` blocks.

const compile = require('vue-template-es2015-compiler'); // Simulate a render function string from vue-template-compiler output const rawRenderFn = ` with(this){ return _c('div', [ _v('Hello ' + (name)), _c('button', { on: { click: () => ({ ...user, active: true }) } }, ['Click']) ]) } `; // Options can be passed, though typically defaults are used by vue-loader const options = {}; try { const compiledResult = compile(rawRenderFn, options); console.log('Processed Render Function:\n', compiledResult); // Expected output will have 'with' removed and ES2015+ features transpiled // e.g., fat arrow functions, object spread to Object.assign } catch (error) { console.error('Compilation Error:', error); }
Debug
Known issues
deprecatedThis package is exclusively for Vue 2 projects. It is superseded by `@vue/compiler-sfc` and `@vue/compiler-dom` in Vue 3 and should not be used in Vue 3 applications.
fix
For Vue 3 projects, use `@vue/compiler-sfc` or `@vue/cli-service` which integrates the correct compilers. If migrating from Vue 2, consult the Vue 3 migration guide.
affects: >=1.0.0
breakingSince version 1.8.0, object rest spread usage within templates is transpiled to `Object.assign` calls. This requires a polyfill for `Object.assign` in older browsers, such as Internet Explorer, to prevent runtime errors.
fix
Ensure `Object.assign` is polyfilled for target browsers, especially IE. Modern Vue CLI setups typically handle this automatically.
affects: >=1.8.0
gotchaThis is an internal package primarily used by build tools like `vue-loader` and `vueify`. Direct programmatic usage by end-user applications is rare and generally not recommended, as its API is subject to change without public deprecation cycles.
fix
Rely on Vue CLI or `vue-loader` to integrate this compiler during the build process, rather than attempting direct usage in application code.
affects: >=1.0.0
gotchaThe package has not been updated since February 2019 (version 1.9.1). This indicates a lack of ongoing maintenance, which may lead to compatibility issues with newer JavaScript features, tooling, or environments not present at the time of its last release.
fix
If encountering issues with modern tooling or language features, consider if your project can upgrade to Vue 3 where compilation is handled by actively maintained packages.
affects: <=1.9.1
Errors
Common errors & fixes
Object.assign is not a function
Attempting to use object rest/spread syntax in Vue 2 templates (transpiled by this compiler) in an environment (e.g., IE) that lacks native `Object.assign` support without a polyfill.
fix
Include a polyfill for `Object.assign` in your project's build process or runtime environment to support older browsers. Modern build setups often include `core-js` for this.
Unknown custom element: <YourComponent> - did you register the component correctly?
Using `vue-template-es2015-compiler` in a Vue 3 project, or misconfiguring Vue 2 components when relying on an outdated build chain. This compiler is Vue 2 specific.
fix
Ensure you are using the correct compiler for your Vue version. For Vue 3, this compiler is not used; `@vue/compiler-sfc` and `@vue/compiler-dom` are the standard. If in Vue 2, verify `vue-loader` and `vue-template-compiler` versions are compatible.
Upgrade
Version history
1.9.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
vue-template-es2015-compiler — npm install vue-template-es2015-compiler · libregistry