Hi,
Just starting to use Sage 9. I’ve seen in other posts that modernizr was removed, what’s the best way to add this back in and to customise it if needed (only add touchevents etc.)?
Hi,
Just starting to use Sage 9. I’ve seen in other posts that modernizr was removed, what’s the best way to add this back in and to customise it if needed (only add touchevents etc.)?
I have tried this to several times. Unfortunately, it still not works. Id like to know it to
Would also like to know hot to do it !
Try and search the forum and you would have found this thread and solution:
Tweak the following steps to use it in Sage 9:
resources/assets/scripts/
directory.resources/assets/scripts/
and run:modernizr -c modernizr-config.json
{
"entry": {
"main": [
"./scripts/main.js",
"./styles/main.scss"
],
"modernizr": [
"./scripts/modernizr.js"
],
"customizer": [
"./scripts/customizer.js"
]
},
"publicPath": "/app/themes/sage",
"devUrl": "http://example.test",
"proxyUrl": "http://localhost:3000",
"cacheBusting": "[name]_[hash:8]",
"watch": [
"app/**/*.php",
"config/**/*.php",
"resources/views/**/*.php"
]
}
yarn build
app/setup.php
before sage/main.js
:wp_enqueue_script('sage/modernizr.js', asset_path('scripts/modernizr.js'), [], null, true);
Very useful! Thanks @Twansparant
Just don’t forget to add modernizr to the eslint ignore file:
.eslintignore
in root theme folder.modernizr.js
entry