Skip to content

Commit 9eb22a2

Browse files
committed
Update Readme, Fix #14
1 parent 74ffa18 commit 9eb22a2

File tree

6 files changed

+640
-17887
lines changed

6 files changed

+640
-17887
lines changed

README.md

Lines changed: 103 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
# Gulp Webpack Starter :octopus:
2+
23
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/wwwebman/gulp-webpack-starter/blob/master/CONTRIBUTING.md)
34
[![GitHub contributors](https://img.shields.io/github/contributors/wwwebman/gulp-webpack-starter.svg)](https://github.com/wwwebman/gulp-webpack-starter/blob/master/CONTRIBUTING.md)
45
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()
56
[![Build Status](https://travis-ci.org/wwwebman/gulp-webpack-starter.svg?branch=master)](https://travis-ci.org/wwwebman/gulp-webpack-starter)
67
[![Gitter](https://img.shields.io/gitter/room/tj/git-extras.svg?style=flat-square)](https://gitter.im/gulp-webpack-starter/Lobby)
78

8-
**Gulp Webpack Starter** - A simple web-development toolkit using Gulp task runner and Webpack bundler. Ideal for building static HTML templates, speeding up [Wordpress](#wordpress) theme development, or any similar template-driven and front-end project.
9+
**Gulp Webpack Starter** - A simple web-development toolkit using Gulp task runner and Webpack bundler.
10+
Ideal for [building static HTML templates](#dart-1-static-html-templating)
11+
or [speeding up Wordpress](#eyes-2-wordpress) theme development
12+
and any similar template-driven and front-end project.
913

1014
![Gulp Webpack Starter](http://webman.pro/assets/img/main/gulp-webpack-starter-webman.jpg)
1115

1216
## List of Content
17+
1318
1. [Features](#gift-features)
1419
1. [Getting Started?](#getting-started)
1520
* [Recommendations](#closed_book-recommendations)
16-
* [Static templating](#dart-static-templating)
17-
* [Wordpress](#eyes-wordpress)
21+
* [Static HTML templating](#dart-1-static-html-templating)
22+
* [Wordpress](#eyes-2-wordpress)
1823
1. [Configuration](#configuration)
1924
1. [Changelog](https://github.com/wwwebman/gulp-webpack-starter/blob/master/CHANGELOG.md)
2025
1. [Contributing](https://github.com/wwwebman/gulp-webpack-starter/blob/master/CONTRIBUTING.md)
2126

2227
## :gift: Features
28+
2329
|Features|Description|
2430
|------------------|-----------|
2531
|CSS| [SASS](http://sass-lang.com/), [SMACSS](https://smacss.com/), [Autoprefixer](https://github.com/postcss/autoprefixer), [clean-css](https://www.npmjs.com/package/gulp-clean-css)|
@@ -32,69 +38,136 @@
3238
|Deployment| [vinyl-ftp](https://www.npmjs.com/package/vinyl-ftp)|
3339

3440
## Getting started?
41+
3542
### :closed_book: Recommendations
43+
3644
Make sure you have the following installed:
3745
* [Node.js](https://nodejs.org/)
3846
* [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/en/)
3947

40-
**Recommended to use node 8.9.* ([last LTS version](https://github.com/nodejs/Release#release-schedule))**
41-
### :dart: Static templating
48+
**Recommended to use Node.js >= v10.16.0**.
49+
50+
## :dart: 1. Static HTML templating
51+
4252
#### Step 1 - clone
53+
4354
```bash
4455
git clone https://github.com/wwwebman/gulp-webpack-starter <my-project-name>
4556
cd <my-project-name>
4657
```
58+
4759
#### Step 2 - run
60+
4861
```bash
4962
yarn
5063
yarn start
5164
```
52-
Easy, right?
5365

54-
### :eyes: Wordpress
55-
#### Step 1 - install Wordpress
66+
**Pretty easy, right?**
67+
68+
***
69+
70+
## :eyes: 2. Wordpress
71+
72+
#### Step 1 - Install Wordpress
73+
5674
Install Wordpress on you localhost (MAMP, LAMP)
57-
#### Step 2 - create theme
75+
76+
#### Step 2 - Create Wordpress Theme
77+
5878
`cd` into your theme directory. E.g.:
79+
5980
```bash
60-
cd project/wp-content/themes/customTheme/
81+
cd project/wp-content/themes/[your_theme_folder]
6182
```
62-
#### Step 3 - clone starter
83+
84+
#### Step 3 - Clone starter
85+
6386
```bash
64-
git clone https://github.com/wwwebman/gulp-webpack-starter frontEnd
65-
cd frontEnd
87+
git clone https://github.com/wwwebman/gulp-webpack-starter [your_frontend_folder_name]
88+
cd [your_frontend_folder_name]
6689
```
67-
#### Step 4 - change config
68-
Certain defaults will need to be changed in **tasks/config.json*** for WP development.
69-
1. Change the global assets output, since we want to export assets to the theme root directory:
70-
```json
71-
"dist": "../"
90+
91+
#### Step 4 - Change config
92+
93+
Edit `./tasks/config.json` file with following instruction:
94+
95+
1. Change the global assets output:
96+
97+
```json
98+
{
99+
"root": {
100+
"dist": ".."
101+
}
102+
}
72103
```
73-
2. Disable the `html` `run` task, since we don’t need to compile HTML in this project:
104+
105+
Starting from now all compiled files will land to `themes/[your_theme_folder_folder]/assets`.
106+
107+
2. Disable the `html` `run` task, since we don’t need to compile HTML in Wordpress:
108+
74109
```json
75-
"html": {
76-
"run": false
77-
},
110+
{
111+
"html": {
112+
"run": false
113+
}
114+
}
78115
```
116+
79117
3. Now, browserSync should use proxy instead of creating a static server:
118+
80119
* `target` should refer to the location (`pwd`) of your local WordPress installation
81-
* `publicPath` should refer to the folder to which you’re outputting the `bundle.js` file. The Reason - issue [GWS - 3](https://github.com/wwwebman/gulp-webpack-starter/issues/3)
120+
* `publicPath` should refer to the folder to which you’re outputting the `bundle.js` file.
121+
The Reason - issue [GWS - 3](https://github.com/wwwebman/gulp-webpack-starter/issues/3).
122+
82123
```json
83-
"proxy": {
84-
"target": "localhost/project",
85-
"publicPath" : "http://localhost:3333/project/wp-content/themes/customTheme/dist/assets/js",
124+
{
125+
"proxy": {
126+
"target": "http://localhost/[your_project]",
127+
"publicPath" : "http://localhost:3333/[your_project]/wp-content/themes/[your_theme_folder]/assets/js/"
86128
}
129+
}
87130
```
131+
88132
#### Step 5 - run
133+
89134
```bash
90135
yarn
91136
yarn start
92137
```
93138

139+
**This is cool, isn't it?**
140+
141+
If you still have a problem, let us know by opening an [issue](https://github.com/wwwebman/gulp-webpack-starter/issues).
142+
94143
## Commands
144+
95145
```bash
96-
yarn <script> //alternative: npm run <script>
97-
yarn start //Run development mode
98-
yarn build //Compiles your App for production
99-
yarn deploy //Push production version on remote server using FTP
146+
yarn <script> // alternative: npm run <script>
147+
148+
yarn start // Run development mode
149+
yarn build // Compiles your App for production
150+
```
151+
152+
### Bonus
153+
154+
You can add credentials in `./tasks/config.json` and deploy project using FTP server.
155+
156+
```json
157+
{
158+
"deploy": {
159+
"hostname": "",
160+
"username": "",
161+
"path": "/",
162+
"password": ""
163+
}
164+
}
100165
```
166+
167+
Then use the following command:
168+
169+
```bash
170+
yarn deploy
171+
```
172+
173+

dev/js/modules/readme.md renamed to dev/js/modules/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## Example of usage
44
### Vendor libs
55
```js
6-
const jQuery = require('jquery'); // npm install jquery
7-
const fancybox = require("fancybox")($);
6+
const jQuery = require('jquery'); // yarn add jquery
7+
const fancybox = require("fancybox")($); // yarn add jquery
88

99
jQuery(function($) {
1010
$(".fancybox").fancybox();

0 commit comments

Comments
 (0)