Try and search the forum and you would have found this thread and solution:
Tweak the following steps to use it in Sage 9:
- Save the modernizr-config.json file in your
resources/assets/scripts/
directory. - Browse to:
resources/assets/scripts/
and run:
modernizr -c modernizr-config.json
- Add the in step 5 generated modernizr script to your dependencies in the assets/config.json like this:
{
"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"
]
}
- Run
yarn build
- Enqueue your modernizr script in
app/setup.php
beforesage/main.js
:
wp_enqueue_script('sage/modernizr.js', asset_path('scripts/modernizr.js'), [], null, true);