Coder Social home page Coder Social logo

h2atecnologia / vue-plugin-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from posva/vue-plugin-template

0.0 1.0 0.0 105 KB

๐Ÿš€ Solid foundation to start a Vue plugin with the best developer experience and a focus on performance

License: MIT License

JavaScript 92.12% Vue 7.88%

vue-plugin-template's Introduction

vue-plugin-template

โœจ DX experience & lighter plugins ๐Ÿš€

Usage

vue init posva/vue-plugin-template my-awesome-plugin
# Answer some questions
cd my-awesome-plugin
yarn
npm run dev
# ๐ŸŽ‰

Features

Smaller plugin size

Bundle with Rollup. This produces bundles that are easier to debug and more lightweight but is less customizable than Webpack. But don't worry you can also use Webpack instead of Rollup ๐Ÿ˜‰

Single file components

Write your components using .vue files. Those will be compiled into render functions when building your plugin to make them compatible everywhere.

JSX

Add jsx to your js files and they will be compiled as well.

ES6

Use the future features of Javascript.

Pre commit lint and fix

Runs eslint and stylefmt/stylelint before each commit on modified files only and try to fix them automatically to prevent failing CI builds ๐Ÿ˜‰.

Advanced testing

Get the best developer experience by testing the components at the same time you interact with them. Embrace Visual testing ๐Ÿ˜Ž

visual testing

Next generation CSS

Use PostCSS by default with CSSNext to bring you future features of CSS.

SASS

You still need a preprocessor? Choose Webpack as the bundler and access more advanced features

Development-only features

Add warnings to improve the DX of your plugin that are removed when bundling in production mode:

if (process.env.NODE_ENV !== 'production' && warningCondition) {
  warn('You should be doing things this way instead: ...')
}

Refer to Dist files for more information.

Road-map

  • Add flow typings
  • .github folder
  • Add question for tests
  • Add question for visual tests
  • Add question for contribution guidelines
  • Add question for the license
  • Add question for linting

Something you would like to see on the template but not in the road-map? Fire an Issue!

FAQ

Dist files

Q: Why are there 3 different generated files for js in the dist folder?

A: Each one serves its purpose: the non minified file (lib.js) replaces process.env.NODE_ENV by "development" to keep development only features like warning (pretty much like Vue warnings). The CommonJS file (lib.common.js) is meant to be used with bundlers like Webpack or Rollup and keeps the variable process.env.NODE_ENV so it can be replaced by bundlers. The minified version (lib.min.js) strips off development features by replacing process.env.NODE_ENV by "production".

Q: When should I choose Rollup over Webpack for the bundler?

A: If next-css isn't enough for you, it's better to use Webpack. If a feature is missing in vue-rollup-plugin but present on vue-loader you can benefit from it by using Webpack. On the other hand if you're building a simple plugin with few components, you should use Rollup as the bundler to get more lightweight lib sizes.

Contributing

See CONTRIBUTING.md for help about developing this template

License

MIT

vue-plugin-template's People

Contributors

nizulzaim avatar posva avatar shrpne avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.