Closed igmoweb closed 6 years ago
Could we make the root directory a parameter to enqueue_assets()
instead? e.g. enqueue_assets( __DIR__, 'theme-name', [ 'maybe', 'deps' ] )
Actually, better idea, let's redesign the interface to this:
<?php
/**
* @param string $directory Root directory containing `src` directory.
* @param array $opts {
* @type string $handle Style/script handle. (Default is last part of directory name.)
* @type array $scripts Script dependencies.
* @type array $styles Style dependencies.
* }
*/
function enqueue_assets( $directory, $opts = [] );
@rmccue enqueue_assets
is not enqueuing any style. Do we want to do that? When Webpack is up, we don't need to enqueue styles at all, they are inserted inline
@rmccue I pushed a few changes:
base_url
param for production builds.assets-manifest.json
(for production)@rmccue We've been testing this branch for a few weeks and it's working fine for both, dev and build environments. Do we want to do anything else here?
@igmoweb I incorporated much of this PR into #6 which just landed, could you test out with the latest and let me know if that one supersedes this?
Excellent @kadamwhite . Closing here.
The code assumes that we're always working on a theme but we could be using a plugin. This is an actual case for The Sun.