Customizing your @wordpress/scripts build process | WordPress Tutorial | Custom Block Development

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 18

  • @MrinalHaque
    @MrinalHaque 7 месяцев назад

    Awesome. WP Community gets awesome tricks from you.

  • @MichalBluma
    @MichalBluma 2 года назад +2

    Thank you for leaving in the obstacles and woes you faced.
    Always helps.

    • @RyanWelcherCodes
      @RyanWelcherCodes  2 года назад +1

      Thanks for the comment! My imposter syndrome always screams "edit that out" ;)

    • @MichalBluma
      @MichalBluma 2 года назад +2

      @@RyanWelcherCodes ... don't!
      Not only does it humanize you, it already gives the viewer great gotcha moments and will probably make these situations less scary if they (we) hit them.

    • @brittonwalker7341
      @brittonwalker7341 2 года назад +2

      Agreed!

  • @AaronTweeton
    @AaronTweeton Год назад

    Ryan, thank you so much for sharing this!

  • @fatesallow
    @fatesallow 2 года назад

    I was just wrestling with this issue and then it occurred to me that maybe you covered this topic, and you had. Saved the day - thank you!!

  • @brittonwalker7341
    @brittonwalker7341 2 года назад

    Great work Ryan and thanks. This is extremely helpful.

  • @alexandersamokhin
    @alexandersamokhin 2 года назад +2

    Thanks Ryan. This is exactly what I was looking for a few months ago when I started with Gutenberg development. I tried to extend webpack config but got stuck on the part with the entry points lookup. The way that I solved it is by adding a block.json file inside the folder and specifying the script file path inside of it, a small hack I suppose. Here is the idea for your next video: very often developers need to rely on a third-party library like swiper slider for example. What is the best approach to conditionally enqueue it without bundling it inside multiple blocks?

  • @gardelin4793
    @gardelin4793 2 года назад

    Thanks for this explaining. This was very helpful.
    One small suggestion, do not close directories immediately while checking files in vs code sidebar.
    I get it that it your habit, but to us viewers it help a lot just to leave folders open so we can easily compare it with our project :)

  • @BaltoMovie
    @BaltoMovie 2 месяца назад

    This method enqueues ALL block styles/scripts on page even when only one block is used. Is there a way to conditional render each style/script per block?

  • @dansdev
    @dansdev 2 года назад

    Hey Ryan, thanks for the great content! I’ve been following along and trying to implement PostCSS autoprefixing. Any chance you have or plan to do a video on setting something like this up?

    • @RyanWelcherCodes
      @RyanWelcherCodes  2 года назад +2

      If you're using the @wordpress/scripts package, then you already have support for PostCSS and autoprefixer. It should just work!

    • @dansdev
      @dansdev Год назад

      @@RyanWelcherCodes sorry I didn’t realise that you had replied! I am using @wordpress/scripts, but none on my css has prefixes. Is there a particular setting I need to enable for this? Thank man!

  • @jeffersoncarvalho2566
    @jeffersoncarvalho2566 Год назад

    I am testing now, and in the dynamic block i don't needed to enqueue the view script to work...

  • @MonteLogic
    @MonteLogic Год назад

    @9:09 I HAVE to add a webpack.config? sigh

    • @MonteLogic
      @MonteLogic Год назад

      I think the twitch-pre-publish-checklist repo is the only way to avoid the issue I'm refferring to.

  • @yxpt
    @yxpt Год назад

    How to read Gutenberg Block Attributes in ViewScript code?