Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Move rev constant to config file #1116

Merged
merged 1 commit into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ At the start of the build process a check is done to see if a `config.yml` file
If you want to take advantage of [Browsersync](https://www.browsersync.io/) (automatic browser refresh when a file is saved), simply open your `config.yml` file after creating it in the previous step, and put your local dev-server address and port (e.g http://localhost:8888) in the `url` property under the `BROWSERSYNC` object.

#### Static asset hashing / cache breaker
If you want to make sure your users see the latest changes after re-deploying your theme, you can enable static asset hashing. In your `gulpfile.babel.js`, set ``const REVISIONING = true;``. Hashing will work on the ``npm run build`` and ``npm run dev`` commands. It will not be applied on the start command with browsersync. This is by design. Hashing will only change if there are actual changes in the files.
If you want to make sure your users see the latest changes after re-deploying your theme, you can enable static asset hashing. In your `config.yml`, set ``REVISIONING: true;``. Hashing will work on the ``npm run build`` and ``npm run dev`` commands. It will not be applied on the start command with browsersync. This is by design. Hashing will only change if there are actual changes in the files.

### 3. Get started

Expand Down
3 changes: 3 additions & 0 deletions config-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ PATHS:
# Paths to JavaScript entry points for webpack to bundle modules
entries:
- "src/assets/js/app.js"

# Set to true if you want static asset revisioning, helpful for cache busting
REVISIONING: false
5 changes: 1 addition & 4 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ const PRODUCTION = !!(yargs.argv.production);
const DEV = !!(yargs.argv.dev);

// Load settings from settings.yml
const { BROWSERSYNC, COMPATIBILITY, PATHS } = loadConfig();

// Set to true if you want asset revisioning, helpful for cachebusting
const REVISIONING = false;
const { BROWSERSYNC, COMPATIBILITY, REVISIONING, PATHS } = loadConfig();

// Check if file exists synchronously
function checkFileExists(filepath) {
Expand Down