Registry / devops / vue-entry-loader

vue-entry-loader

JSON →
library1.1.5jsnpmunverified

Webpack loader that auto-generates Vue initialization code for .vue entry files, eliminating manual app creation for client and server-side rendering. Designed for easywebpack ecosystem, version 1.1.5 (latest, low activity). Differentiators: zero-config entry for SSR, automatic template injection with store/router hydration, and hook support. Maintained but infrequent updates.

npm install vue-entry-loader
INSTALL
IMPORT
SIG · VUE-ENTRY-LOADER
V
vue-entry-loader
devopsjavascriptv1.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

vue-entry-loader
module.exports = { module: { rules: [{ test: /\.vue$/, loader: 'vue-entry-loader', options: { ... } }] } }
const loader = require('vue-entry-loader')
This is a webpack loader, not a regular Node.js module. Configure it in webpack config under module.rules.
default export (loader function)
// webpack.config.js module.exports = { module: { rules: [{ test: /\.vue$/, use: ['vue-loader', 'vue-entry-loader'] }] } }
import vueEntryLoader from 'vue-entry-loader';
Loader is used in webpack configuration; no direct import in application code. Example shows loader chaining.
options
configureLoader('vue-entry-loader', { inject: true, template: 'custom-template.ejs' })
const options = { inject: true };
Options passed via webpack rule options or loader query string. Complex config may require ejs template path.

Webpack configuration to use vue-entry-loader for automatic Vue app initialization from .vue entry files.

// webpack.config.js (CommonJS) const path = require('path'); module.exports = { entry: { main: './src/main.vue' // direct .vue file as entry }, output: { path: path.resolve(__dirname, 'dist'), filename: '[name].js' }, module: { rules: [ { test: /\.vue$/, use: [ 'vue-loader', { loader: 'vue-entry-loader', options: { // enable auto initialization template inject: true } } ] } ] }, resolve: { extensions: ['.vue', '.js'] }, plugins: [ new VueLoaderPlugin() ] }; // Ensure vue-loader and vue-template-compiler are installed // npm install vue-loader vue-template-compiler --save-dev
Debug
Known issues
gotchavue-entry-loader modifies .vue file output by injecting initialization code; this breaks if .vue file is used as a component in other entries.
fix
Only use this loader on entry .vue files (e.g., via webpack entry config) and exclude from component rules using `include` or separate rules.
affects: >=0.0.0
deprecatedDependence on `vuex-router-sync` for SSR; this package is no longer maintained and may cause issues with Vue 2.6+ or Vue 3.
fix
For modern Vue SSR, consider using `vuex` and `vue-router` directly or migrate to vue-entry-loader alternatives.
affects: >=1.0.0
gotchaRequires Vue 2.x; does not work with Vue 3. The injected template uses Vue.extend and options API.
fix
Use Vue 2.x or use vue-loader for Vue 3; this loader is not compatible.
affects: >=1.0.0
gotchaThe `inject` option defaults to `false`; without it, loader acts as pass-through and no initialization code is added.
fix
Set `inject: true` or provide a custom template via `template` option to enable auto-injection.
affects: >=1.0.0
gotchaWhen using SSR, the loader exports a function that returns a Promise, not the Vue instance directly. This may confuse developers expecting server-entry.js pattern.
fix
Check documentation for SSR integration; the loader-generated entry is used in a bundleRenderer or renderToString call.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'vue-entry-loader'
Missing dependency or incorrect path in webpack config.
fix
Run `npm install vue-entry-loader --save-dev` and ensure node_modules is in require path.
Module not found: Error: Can't resolve 'vue' in '...'
vue is not installed when using loader's injected code.
fix
Install vue: `npm install vue --save`.
Uncaught ReferenceError: Vue is not defined
Loader template uses Vue directly but it's not imported in the injected code.
fix
The loader injects `import Vue from 'vue';` automatically; ensure `vue` is resolvable and webpack is configured to handle ES modules.
TypeError: Cannot read properties of undefined (reading 'router')
Vue component does not export `router` function or object, but SSR template expects it.
fix
Ensure your .vue file exports the router same way as store, or use a custom template that handles missing router gracefully.
Upgrade
Version history
1.1.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources