# entrypoint-wrapper-webpack-plugin **Repository Path**: mirrors_alibaba/entrypoint-wrapper-webpack-plugin ## Basic Information - **Project Name**: entrypoint-wrapper-webpack-plugin - **Description**: 一款用于包装 Entry 配置的 Webpack 插件 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-03-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Entrypoint wrapper webpack plugin ## Description 一款用于包装 Entry 配置的 Webpack 插件。 ## Install ```bash npm i -D entrypoint-wrapper-webpack-plugin ``` ## Usage ```js const EntryPoint = require('entrypoint-wrapper-webpack-plugin'); module.exports = { entry: { 'common': ['vue', 'vuex'], 'my/index': 'src/views/my/index.vue' }, plugins: [ new EntryPoint({ include: /.*\.vue$/, file: './default_index.js' // wrapper file }) ] } ``` ```js const EntryPoint = require('entrypoint-wrapper-webpack-plugin'); module.exports = { entry: { 'common': ['vue', 'vuex'], 'my/index': 'src/views/my/index.vue' }, plugins: [ new EntryPoint({ include: /.*\.vue$/, // template string template: 'import Main from '<%= origin %>';Main.el = '#root';new Vue(Main)' }) ] } ``` ```js const EntryPoint = require('entrypoint-wrapper-webpack-plugin'); module.exports = { entry: { 'common': ['vue', 'vuex'], 'my/index': 'src/views/my/index.vue' }, plugins: [ new EntryPoint({ include: /.*\.vue$/, // template function template: function(params){ return `import Main from '${params.origin}';Main.el = '#root';new Vue(Main)` } }) ] } ``` ## Options |Name|Type|Default|Description| |:--:|:--:|:--:|:----------| |`skipExistFiles`|`{Boolean}`|`false`|skip existing files| |`include`|`{RegExp}`|`/.*/`|included files| |`file`|`{String}`|`''`|wrapper path| |`template`|`{Function,String}`|`''`|wrapper template|