Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Patches "dom-compare-temp" to allow development with Vue on Wordpress Sage sites

Notifications You must be signed in to change notification settings

documents-org/dom-compare-temp-vue-patch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Patch for 'dom-compare-temp' on Sage + Vue configurations

The default dev config of Sage's wordpress theme uses dom-compare-temp as a transitive dependency to live-update the page while you develop. Using Vue, the node process crashes when this dependency encounters document fragments.

This patch allows to use Vue a bit better, at least without crashes. See here :

https://discourse.roots.io/t/sage-9-vue-js-no-jquery/14162/3

Usage

Add dom-compare-temp as a dev dependency to be able to require it directly without ESLint complaining :

yarn -D add dom-compare-temp

sage/resources/assets/build/config.js before

const path = require('path');
const { argv } = require('yargs');
const merge = require('webpack-merge');
const desire = require('./util/desire');
// etc..

sage/resources/assets/build/config.js after

const path = require('path');
const { argv } = require('yargs');
const merge = require('webpack-merge');
const patch = require('./dom-compare-patch');
const domCompare = require('dom-compare-temp');
patch(domCompare);
const desire = require('./util/desire');

Method

Since the code of dom-compare-temp/compare resides in an IIFE we're duplicating it here to be able to replace it.

Crashes are then "resolved".

About

Patches "dom-compare-temp" to allow development with Vue on Wordpress Sage sites

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published