2017 © Pedro Peláez
 

project craft-vue

Craft CMS

image

chasegiunta/craft-vue

Craft CMS

  • Friday, July 27, 2018
  • by chasegiunta
  • Repository
  • 1 Watchers
  • 34 Stars
  • 44 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 4 Open issues
  • 5 Versions
  • 340 % Grown

The README.md

craft-vue

All the power of Vue CLI's scaffolding & single file components tailored for a Craft CMS project., (*1)

What's Included

  • npm run dev / yarn dev: first-in-class development experience., (*2)

    • Webpack + vue-loader for single file Vue components
    • State preserving hot-reload
    • Page reloading on file edits (twig, html, etc)
    • State preserving compilation error overlay
    • Lint-on-save with ESLint
    • Source maps
  • npm run build / yarn build: Production ready build., (*3)

    • JavaScript minification with UglifyJS v3
    • Babel compiling
    • CSS across all components extracted into a single file and minified with cssnano
    • Static assets compiled with version hashes for efficient long-term caching
    • Bundle size analytics

Fork It And Make Your Own

You should fork this repo to create your own opinionated boilerplate for your setup. This template makes no assumptions about pre-processors, template structure, or linting configurations., (*4)

I've also created a fork of this boilerplate that integrates TailwindCSS & Purgecss., (*5)

Setup

This boilerplate requires Vue CLI 3 be installed globally on your machine., (*6)

# create & install project
composer create-project chasegiunta/craft-vue PATH

# run Craft's setup & install
./craft setup

# install the Twigpack plugin
./craft install/plugin twigpack

# install dependencies
npm install # yarn

# run dev server (default runs on localhost:8080)
npm run dev # yarn dev (alias for 'yarn serve')

# build for production with minification
npm run build # yarn build

Once up and running, the fun part comes in using Vue CLI's GUI to customize your project to suite your needs. Simply run vue ui and import your newly created project to get started., (*7)

You can also run your dev & build tasks from the GUI to get valuable build stats & runtime analytics., (*8)

NOTE: During development, only your assets will be served from localhost:8080 and referenced in the base template. You'll still load your site locally under your normal development domain (mysite.test, etc.). This will also cause a brief unstyled flash on page loads due to JS/CSS assets loading from javascript for development. This flash isn't present after build, on production., (*9)

If webpack's dev server (yarn dev) is not running, Twigpack will serve your assets from the build directory., (*10)

For a detailed explanation on how things work, check out the Twigpack docs & Vue CLI docs., (*11)

Pre-Processors

This boilerplate has pre-configured CSS extraction for most popular CSS pre-processors including LESS, SASS, Stylus, and PostCSS. To use a pre-processor, all you need to do is install the appropriate webpack loader for it. For example, to use SASS:, (*12)

npm install sass-loader node-sass --save-dev
# yarn add sass-loader node-sass --dev

Note you also need to install node-sass because sass-loader depends on it as a peer dependency., (*13)

Read more about this at https://cli.vuejs.org/guide/css.html#pre-processors, (*14)

Automatic Component Registration

Any vue components placed within src/components will be registered with Vue automatically. You may nest these in subfolders if you wish., (*15)

Babel Compiling

This boilerplate uses babel-preset-env for configuring babel. You can read more about it here., (*16)

Linting

You can enable linting by adding the @vue/cli-plugin-eslint plugin through the GUI vue ui., (*17)

The Versions

27/07 2018

dev-vue-cli

dev-vue-cli https://craftcms.com/

Craft CMS

  Sources   Download

MIT

The Requires

 

cms project craftcms craft

22/06 2018

dev-master

9999999-dev https://craftcms.com/

Craft CMS

  Sources   Download

MIT

The Requires

 

cms project craftcms craft

22/06 2018
09/04 2018
03/04 2018