0.1.0 • Published 8 years ago

phplocal v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

php-local

An npm script based utility for running PHP based sites locally, and processing SCSS on the fly. You can use this on it's own, or fold it into another PHP based site system, like Kirby, for example.

Requirements

The only requirement is that you have Node.js installed, which comes with npm. I've only tested this on OS X 10.11.1, which comes with a PHP pre-installed, so it might not work in other OSes.

Install

Like any npm script, do a one time install: npm install

Use

This one command will get you running: npm run dev

What's hapening?

Two things mainly: SCSS is getting processed into CSS, and the directory is being served via your local PHP server.

Screenshot

The full CSS process

Each time your SCSS files are saved

  1. The old CSS file is deleted.
  2. The SCSS is processed to CSS.
  3. The processed CSS is run through POSTCSS and the Autoprefixer plugin.
  4. The CSS is minified

What's not here?

Tons of goodies such as live-reloading in the browser, or any kind of javascript processing. This and more can be added in a purely npm script environment, but at a certain level of complexity you might benefit from helpers like Gulp, Webpack, etc.

How to I modify for my own use?

It's all in the package.json file, you can:

  • change the directory where SCSS/CSS are stored
  • add more functions
  • change the default serving port

POSTCSS options

These are stored in the postcss.json file, you can modify Autoprefixer's browser compatibility settings there for example.