All Projects โ†’ jaredpalmer โ†’ Presspack

jaredpalmer / Presspack

Licence: mit
๐Ÿ’ป Wordpress like it's 2020 with Webpack and Docker

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Presspack

Wp Webpack Script
๐Ÿ’ฅ๐Ÿ”ฅ๐Ÿ“ฆ๐Ÿ‘ฉโ€๐Ÿ’ป An easy to use, pre configured, hackable webpack setup & development server for WordPress themes and plugins.
Stars: โœญ 314 (-52.28%)
Mutual labels:  webpack, babel, wordpress
Wordless
All the power of Pug, Sass, Coffeescript and WebPack in your WordPress theme. Stop writing themes like it's 1998.
Stars: โœญ 1,374 (+108.81%)
Mutual labels:  webpack, babel, wordpress
Wordpress Starter
๐Ÿ“ฆ A starter template for WordPress websites
Stars: โœญ 26 (-96.05%)
Mutual labels:  webpack, babel, wordpress
Woo Next
๐Ÿš€ React WooCommerce theme, built with Next JS, Webpack, Babel, Node, Express, using GraphQL and Apollo Client
Stars: โœญ 342 (-48.02%)
Mutual labels:  webpack, babel, wordpress
Babel Loader
๐Ÿ“ฆ Babel loader for webpack
Stars: โœญ 4,570 (+594.53%)
Mutual labels:  webpack, babel
Backpack
๐ŸŽ’ Backpack is a minimalistic build system for Node.js projects.
Stars: โœญ 4,466 (+578.72%)
Mutual labels:  webpack, babel
Slinky
A light-weight, responsive, mobile-like navigation menu plugin
Stars: โœญ 649 (-1.37%)
Mutual labels:  webpack, babel
Xiaoduyu.com
๐ŸŸๅฐๅบฆ้ฑผ - ๅนด่ฝปไบบ็š„ไบคๆต็คพๅŒบ https://www.xiaoduyu.com
Stars: โœญ 549 (-16.57%)
Mutual labels:  webpack, babel
Webpack Boilerplate
A minimal webpack 5 boilerplate with only Babel, SASS and lodash (optional) on board
Stars: โœญ 404 (-38.6%)
Mutual labels:  webpack, babel
Babel Minify Webpack Plugin
[DEPRECATED] Babel Minify Webpack Plugin
Stars: โœญ 502 (-23.71%)
Mutual labels:  webpack, babel
React Webpack Typescript Starter
Minimal starter with hot module replacement (HMR) for rapid development.
Stars: โœญ 632 (-3.95%)
Mutual labels:  webpack, babel
Ts Monorepo
Template for setting up a TypeScript monorepo
Stars: โœญ 459 (-30.24%)
Mutual labels:  webpack, babel
React Starter Kit
React Starter Kit โ€” front-end starter kit using React, Relay, GraphQL, and JAM stack architecture
Stars: โœญ 21,060 (+3100.61%)
Mutual labels:  webpack, babel
Angular2 Babel Esnext Starter
Angular development and testing examples with Babel in Javascript (ES6/ES7).
Stars: โœญ 497 (-24.47%)
Mutual labels:  webpack, babel
React
React+webpack+redux+ant design+axios+lessๅ…จๅฎถๆกถๅŽๅฐ็ฎก็†ๆก†ๆžถ
Stars: โœญ 4,414 (+570.82%)
Mutual labels:  webpack, babel
Naomi
Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Stars: โœญ 544 (-17.33%)
Mutual labels:  webpack, babel
Nwb
A toolkit for React, Preact, Inferno & vanilla JS apps, React libraries and other npm modules for the web, with no configuration (until you need it)
Stars: โœญ 5,429 (+725.08%)
Mutual labels:  webpack, babel
Serverless Plugin Typescript
Serverless plugin for zero-config Typescript support
Stars: โœญ 611 (-7.14%)
Mutual labels:  webpack, babel
React App
Create React App with server-side code support
Stars: โœญ 614 (-6.69%)
Mutual labels:  webpack, babel
React Isomorphic Boilerplate
๐ŸŒŸ An universal React isomorphic boilerplate for building server-side render web app.
Stars: โœญ 653 (-0.76%)
Mutual labels:  webpack, babel

Presspack

Make WordPress theme development great again.

Discord

Features

  • Modern JavaScript through Webpack
  • Live reload via BrowserSync
  • SCSS support
  • Easy dev environments with Docker Compose
  • Stateless, immutable plugin management via Composer
  • Helpful HTML5 Router for firing JS based on WordPress page slug.
  • Nothing else.

Requirements

  • Node.js
  • Yarn
  • PHP and Composer
  • Docker for Mac / Windows
  • Docker Compose

Getting Started

git clone [email protected]:jaredpalmer/presspack.git
yarn install
composer install # if you want plugins ( not required )
docker-compose up

Developing Locally

To work on the theme locally, open another window/tab in terminal and run:

yarn start

This will open a browser, watch all files (php, scss, js, etc) and reload the browser when you press save.

Building for Production

To create an optimized production build, run:

yarn build

This will minify assets, bundle and uglify javascript, and compile scss to css. It will also add cachebusting names to then ends of the compiled files, so you do not need to bump any enqueued asset versions in functions.php.

Changing ports

There are two ports involved, the port of the dockerized WordPress instance, and the port the Browser Sync runs on. To change the port of the dockerized WordPress instance go into docker-compose.yml and modify ports.

# docker-compose.yml
 ...
  ports:
    - "9009:80" # only need to change `9009:80` --> localhost:9009
 ...

If you want to change the port you develop on (the default is 4000), then open scripts/webpack.config.js and modify BrowserSyncPlugin's port option. If you changed the WordPress port above, be sure to also change proxy accordingly. Don't forget the trailing slash.

// scripts/webpack.config.js
...
new BrowserSyncPlugin({
  notify: false,
  host: 'localhost',
  port: 4000, // this is the port you develop on. Can be anything.
  logLevel: 'silent',
  files: ['./*.php'],
  proxy: 'http://localhost:9009/', // This port must match docker-compose.yml
}),
...

Project Structure

.
โ”œโ”€โ”€ composer.json                # Compose dependencies (plugins)
โ”œโ”€โ”€ composer.lock                # Composer lock file
โ”œโ”€โ”€ docker-compose.yml           # Docker Compose configuration
โ”œโ”€โ”€ package.json                 # Node.js dependencies
โ”œโ”€โ”€template                      # Wordpress PHP theme files
โ”‚   โ”œโ”€โ”€ footer.php
โ”‚   โ”œโ”€โ”€ functions.php
โ”‚   โ”œโ”€โ”€ header.php
โ”‚   โ”œโ”€โ”€ index.php
โ”‚   โ””โ”€โ”€ page.php
โ”œโ”€โ”€scripts                       # Build / Dev Scripts
โ”‚   โ”œโ”€โ”€ build.js                 # Build task
โ”‚   โ”œโ”€โ”€ start.js                 # Start task
โ”‚   โ””โ”€โ”€ webpack.config.js        # Webpack configuration
โ””โ”€โ”€src
    โ”œโ”€โ”€ index.js                 # JavaScript entry point
    โ”œโ”€โ”€ routes                   # Routes
    โ”‚   โ”œโ”€โ”€ common.js            # JS that will run on EVERY page
    โ”‚   โ””โ”€โ”€ <xxx>.js             # JS that will run on pages with <xxx> slug
    โ”œโ”€โ”€ style.scss               # SCSS style entry point
    โ”œโ”€โ”€ styles                   # SCSS
    โ”‚   โ”œโ”€โ”€ _global-vars.scss
    โ”‚   โ”œโ”€โ”€ _base.scss
    โ”‚   โ””โ”€โ”€ ...
    โ””โ”€โ”€ util
        โ”œโ”€โ”€ Router.js            # HTML5 Router, DO NOT TOUCH
        โ””โ”€โ”€ camelCase.js         # Helper function for Router, DO NOT TOUCH

Local Database Backup

Here's how to dump your local database with Docker into a .sql file

docker exec -it host_db_1 /usr/bin/mysqldump -u username -ppassword database_name > backup.sql

Local Database Restore

Restore a previous database backup

docker exec -i host_db_1 /usr/bin/mysql -u username -ppassword database_name < backup.sql

Author

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].