vuepack
:package: A modern starter which uses Vue 2, Vuex, Vue-router and Webpack 2 (and even Electron)
Top Related Projects
🛠️ webpack-based tooling for Vue.js Development
A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
📝 Minimalistic Vue-powered static site generator
Create Nuxt.js App in seconds.
Quasar Framework - Build high-performance VueJS user interfaces in record time
Next generation frontend tooling. It's fast!
Quick Overview
VuePack is a modern starter kit for Vue.js projects. It combines Vue.js with Webpack, offering a pre-configured development environment that includes hot-reloading, CSS extraction, and production-ready builds. VuePack aims to simplify the process of setting up a new Vue.js project with best practices and optimal configurations.
Pros
- Pre-configured setup saves time and reduces initial project setup complexity
- Includes hot-reloading for a smoother development experience
- Optimized for production builds with code splitting and CSS extraction
- Integrates popular tools like Webpack, Babel, and ESLint out of the box
Cons
- May include unnecessary dependencies for simpler projects
- Less flexibility compared to setting up a project from scratch
- Potential learning curve for developers unfamiliar with the included tools
- Might become outdated if not regularly maintained
Getting Started
To get started with VuePack, follow these steps:
-
Install VuePack globally:
npm install -g vuepack
-
Create a new project:
vuepack init my-project cd my-project
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
Your Vue.js application will now be running at http://localhost:4000
.
Competitor Comparisons
🛠️ webpack-based tooling for Vue.js Development
Pros of vue-cli
- Official Vue.js project scaffolding tool with extensive ecosystem support
- Highly configurable with a plugin-based architecture
- Provides a graphical user interface for project management
Cons of vue-cli
- Steeper learning curve due to more complex configuration options
- Potentially slower project setup compared to simpler alternatives
Code Comparison
vuepack:
// webpack.config.js
module.exports = {
entry: './src/index.js',
// ... other configurations
}
vue-cli:
// vue.config.js
module.exports = {
configureWebpack: {
// ... webpack configurations
}
}
Key Differences
- vuepack is a lightweight, opinionated boilerplate for Vue.js projects
- vue-cli offers more flexibility and customization options
- vuepack uses a single webpack configuration file, while vue-cli uses a dedicated configuration file (vue.config.js)
- vue-cli provides better integration with the Vue ecosystem and official plugins
Use Cases
- Choose vuepack for quick prototyping and simpler projects
- Opt for vue-cli when building complex applications or requiring extensive customization
Community and Support
- vue-cli has a larger community and more frequent updates
- vuepack is maintained by a single developer, which may impact long-term support
A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
Pros of webpack
- More comprehensive and feature-rich, offering a wider range of configuration options
- Better documentation and community support due to being an official Vue.js template
- Includes more advanced features like hot module replacement and code splitting out of the box
Cons of webpack
- Steeper learning curve due to its complexity and extensive configuration options
- Slower build times, especially for larger projects, compared to vuepack's simpler setup
- Requires more setup and configuration to get started, which may be overwhelming for beginners
Code Comparison
webpack:
module.exports = {
entry: './src/main.js',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'build.js'
},
// ... more configuration options
}
vuepack:
module.exports = {
entry: ['./client/index.js'],
output: {
path: _.outputPath,
filename: '[name].js',
publicPath: '/'
},
// ... simpler configuration
}
The webpack template provides more detailed configuration options, while vuepack offers a more streamlined approach with fewer options to configure. This reflects the overall philosophy of each project, with webpack focusing on flexibility and customization, and vuepack prioritizing simplicity and ease of use.
📝 Minimalistic Vue-powered static site generator
Pros of VuePress
- Specifically designed for creating documentation sites
- Built-in markdown support with Vue components
- Automatic code syntax highlighting
Cons of VuePress
- Less flexible for general-purpose web applications
- Steeper learning curve for non-documentation projects
Code Comparison
VuePress configuration:
module.exports = {
title: 'My Documentation',
description: 'A VuePress site',
themeConfig: {
nav: [{ text: 'Home', link: '/' }]
}
}
VuePack configuration:
module.exports = {
entry: './src/index.js',
output: {
path: './dist',
filename: 'bundle.js'
}
}
Key Differences
- VuePress is tailored for documentation sites, while VuePack is a more general-purpose Vue.js boilerplate
- VuePress offers built-in features for documentation, such as sidebar generation and search functionality
- VuePack provides a minimal setup for Vue.js applications with webpack configuration
Use Cases
- Choose VuePress for creating documentation sites or blogs with minimal setup
- Opt for VuePack when building custom Vue.js applications with more flexibility in project structure
Community and Maintenance
- VuePress has a larger community and is actively maintained by the Vue.js core team
- VuePack has fewer contributors and less frequent updates
Create Nuxt.js App in seconds.
Pros of create-nuxt-app
- More comprehensive scaffolding options, including server-side rendering and static site generation
- Better integration with the Nuxt.js ecosystem and its features
- Actively maintained with frequent updates and a larger community
Cons of create-nuxt-app
- Potentially more complex setup process for simple projects
- Heavier initial project structure, which may be overkill for small applications
Code Comparison
create-nuxt-app:
// nuxt.config.js
export default {
modules: ['@nuxtjs/axios'],
buildModules: ['@nuxt/typescript-build'],
// ... more configuration options
}
vuepack:
// config/index.js
module.exports = {
port: 4000,
webpack: {
// ... webpack configuration
}
}
Key Differences
- create-nuxt-app focuses on Nuxt.js-specific features and conventions
- vuepack provides a more lightweight and flexible setup for Vue.js projects
- create-nuxt-app offers more built-in options for modern web development practices
- vuepack allows for easier customization of the build process
Use Cases
- Choose create-nuxt-app for full-featured Nuxt.js applications with SSR support
- Opt for vuepack when building simpler Vue.js SPAs or when more control over the project structure is needed
Quasar Framework - Build high-performance VueJS user interfaces in record time
Pros of Quasar
- More comprehensive framework with a larger ecosystem and community support
- Offers a wide range of UI components and tools for building cross-platform applications
- Provides better documentation and learning resources
Cons of Quasar
- Steeper learning curve due to its extensive feature set
- Potentially heavier and more complex for simple projects
- May introduce unnecessary overhead for developers who don't need all its features
Code Comparison
Quasar component example:
<template>
<q-page>
<q-btn color="primary" label="Click me" />
</q-page>
</template>
<script>
export default {
name: 'MyPage'
}
</script>
Vuepack component example:
<template>
<div class="page">
<button class="btn">Click me</button>
</div>
</template>
<script>
export default {
name: 'MyPage'
}
</script>
Quasar provides built-in components like q-page
and q-btn
, while Vuepack relies on more basic HTML elements. Quasar's approach offers more out-of-the-box functionality but may require learning its specific component library. Vuepack's simpler structure allows for more flexibility but requires more manual styling and implementation of features.
Next generation frontend tooling. It's fast!
Pros of Vite
- Faster development server and build process due to native ES modules
- Broader ecosystem support and active community
- Built-in support for TypeScript, JSX, and CSS pre-processors
Cons of Vite
- Steeper learning curve for developers new to ES modules
- May require additional configuration for complex projects
- Less opinionated, which can lead to decision fatigue for some developers
Code Comparison
Vite configuration:
// vite.config.js
export default {
plugins: [],
build: {
target: 'esnext'
}
}
VuePack configuration:
// config/index.js
module.exports = {
port: 4000,
webpack: {
// webpack configuration
}
}
Vite uses a more modern, ES module-based approach, while VuePack relies on a more traditional webpack configuration. Vite's setup is generally simpler and requires less boilerplate code.
Vite has gained significant popularity and is actively maintained, offering a more robust and future-proof solution for Vue.js projects. VuePack, while still functional, has not seen recent updates and may lack support for newer Vue.js features and optimizations.
Overall, Vite provides a more performant and flexible development experience, but may require some adjustment for developers accustomed to traditional build tools. VuePack offers a simpler, more opinionated setup that might be preferable for smaller projects or developers seeking a quick start.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
VuePack is a modern Vue.js starter
which uses Vue 2, Vuex, Vue-router and Webpack 2.
Note
I highly recommend you to try Poi, you can develop Vue.js app with no-config until you need it. Less boilerplate code, more happiness â¤ï¸
Here's the plan for VuePack 4.0, you can support my work by donating or joining the development.
Features
- Vue 2 / Vue-router / Vuex
- Hot reloading for single-file components
- Split vendor code from your app
- Webpack 2 (an update to Webpack 4 will be very soon)
- Offline Ready, perfect for progressive web app
- ESLint
- Babel 6
- PostCSS
- JSX components are supported by default
- TestCafe (optional)
- Electron support (optional)
- CSS modules (optional)
- A boilerplate which is small and focusing on client-side apps
Check out the docs for more usages.
Get Started
You'd better have node >=10
and npm >=6
installed:
sao
This template can be used with SAO, which also means you can use the template offline:
npm i -g sao jstransformer-handlebars
# from npm
sao vuepack new-project
# or git repo
sao egoist/vuepack new-project
Vue CLI
Vue CLI (vue-cli@2
or @vue/cli@>=3
+ @vue/cli-init
) is still supported, but it has been deprecated by Vue officially, so it is not recommended to use Vue CLI with Vuepack.
npm i -g @vue/cli @vue/cli-init
vue init egoist/vuepack
For Windows users
Install git with unix tools
before getting started.
Folder Structure
If you did not enable Electron support, the dest folder is ./dist
, otherwise it's ./app/dist
.
./app
folder only exists when you enabled Electron support.
âââ app # the actual app you want to bundle with Electron
â âââ dist # directory which contains all bundled files
â âââ index.js # entry file for Electron
âââ build # webpack configs and other scripts
âââ client # client-side app files
âââ dist # bundled files and index.html
â âââ index.html
â âââ [...other bundled files]
âââ tests # e2e tests written by testcafe
âââ node_modules # dependencies
âââ package.json # package info
Custom template
You want to customize the output of index.html
, simply modify index.html, see more at html-webpack-plugin.
License
MIT © EGOIST
Top Related Projects
🛠️ webpack-based tooling for Vue.js Development
A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
📝 Minimalistic Vue-powered static site generator
Create Nuxt.js App in seconds.
Quasar Framework - Build high-performance VueJS user interfaces in record time
Next generation frontend tooling. It's fast!
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot