Sage Classic Editor Styles

I’m attempting to use add_editor_style to load my compiled app.scss file in TinyMCE.

I’ve read that we should use \Roots\bundle for this, but looking at its code I can’t figure out the right combination.

The most recent I’ve tried would be

add_editor_style(bundle(‘app’)->css()->first());

But whenever I use the css() method I get the following error:

Warning: Undefined array key “css” in /Sites/lakeshore/wp-content/plugins/acorn/src/Roots/Acorn/Assets/Bundle.php on line 50

Thanks for any help you can provide.

Looks like your bundle doesn’t have any CSS in it:

  1. Have you run a build?
  2. Have you checked your manifest.json to see what’s being built?
  3. What’s your bud configuration look like?

Hm… Strange…

Checking the manifest.json I’m not seeing my CSS file referenced. It is getting loaded fine on the frontend. I have run the build process.

I’m using the @roots/bud-sass package. Here’s my config.

/**
 * @typedef {import('@roots/bud').Bud} bud
 *
 * @param {bud} app
 */
module.exports = async (app) => {
  app
    /**
     * Application entrypoints
     *
     * Paths are relative to your resources directory
     */
    .entry({
      app: ['@scripts/app', '@styles/app'],
      admin: ['@scripts/admin', '@styles/admin'],
      editor: ['@scripts/editor', '@styles/editor'],
    })

    .hooks.on("build.module.noParse", undefined)

    .provide({
      jquery: ["jQuery", "$"],
    })

    /**
     * These files should be processed as part of the build
     * even if they are not explicitly imported in application assets.
     */
    .assets('images')

    /**
     * These files will trigger a full page reload
     * when modified.
     */
    .watch('resources/views/**/*', 'app/**/*')

    /**
     * Target URL to be proxied by the dev server.
     *
     * This is your local dev server.
     */
    .proxy('http://lakeshore.test')

    /**
     * Development URL
     */
    .serve('http://lakeshore.test:3000');
};

Thanks