hello everyone,
I have this external JS, called let’ say myfile.js
.
I have:
- updated config.json in resources path:
"entry": {
"main": [
"./scripts/main.js",
"./styles/main.scss"
],
"customizer": [
"./scripts/customizer.js"
],
"myfile": [
"./scripts/util/myfile.js"
]
},
- imported into setup.php
...
add_action('wp_enqueue_scripts', function () {
wp_enqueue_style('sage/main.css', asset_path('styles/main.css'), false, null);
wp_enqueue_script('sage/main.js', asset_path('scripts/main.js'), ['jquery'], null, true);
wp_enqueue_script('sage/myfile', asset_path('scripts/util/myfile.js'), ['jquery'], null, true);
...
I yarn run start
and re-build everything BUT the file cannot be found in the DIST directory.
https://localhost:3000/app/themes/MY_THEME/dist/scripts/util/myfile.js
is missing…
and therefore, if I try to call the class whiting a finalize() function, it fails…
any hint?
ty!