create-guten-block icon indicating copy to clipboard operation
create-guten-block copied to clipboard

Add files to build sequence

Open shanept opened this issue 5 years ago • 2 comments

I am writing a block that utilizes an external javascript library - progressbar.js For this, I will need a script that I can load on the frontend that will execute the library upon each block. My preferred method would be to have a script where I can import progressbar.js, have my logic for executing on my elements, and I would like this to build and be in the dist directory so I may enqueue it with WordPress.

What I have noticed in attempting to do this, is that the scripts are implemented in a node dependency and don't appear to support this. Short of creating my own script to do this, I don't see any other options to achieve this preferred build method.

Can we have a configuration option for additional JS files during the start/run build sequences?

shanept avatar Nov 26 '18 01:11 shanept

Is there a working solution to this problem? I am new to webpack, and kinda new to ES6. I am also looking for a convenient way of compiling a js file for use on the frnt end.

stljeff1 avatar Feb 13 '19 00:02 stljeff1

The solution in this pull request works for me. I wonder if it can me merged...

stljeff1 avatar Feb 13 '19 02:02 stljeff1