I've tried the same approach on Magento 2.1.7 and Magento 2.2.1 and it worked in M2.1.7 but not M2.2.1 unless something else is going on...
The approach I used was to edit
default_head_blocks.xml in directory
app/design/frontend/<VENDOR_NAME>/<MODULE_NAME>/Magento_Theme/layout which looks like:
<?xml version="1.0"?> <!-- /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <script src="js/smartlook.js" /> <!-- Also tried: <script src="Magento_Theme::js/smartlook.js" /> --> </head> </page>
On Magento 2.1.7 I can see this file in the
<head> section, but it doesn't seem to show up in Magento 2.2.1 after doing
Magento_Theme::js/smartlook.js my problem was a silly mistake :/