• Dear all,

    I have written some custom functions in separate files (outside the block’s folder) and imported them to use in the custom block functionality (in edit.js file). But when I built it, I see these files 488.js and 779.js in the build folder (the screenshot). I understand that these files are due to my imports. I built it using wp-scripts without any other custom configuration.

    My question is, is there a way to not have these random numbers of JS files (I mean they will be minified in index.js file e.g.), but if not, is there a way to add names to them (to not have random numbered JS files)?

    Thanks in advance,
    Vahan

Viewing 1 replies (of 1 total)
  • Thread Starter Vahan

    (@vahan889)

    hi @mjani ,

    Thanks for the reply.

    I got you and added a webpack.config.js file:

    const defaultConfig = require('@wordpress/scripts/config/webpack.config.js');

    module.exports = {
    ...defaultConfig,
    optimization: {
    splitChunks: {
    chunks: 'none',
    },
    },
    };

    But when I run this command wp-scripts build --webpack-src-dir=blocks/{the_block}/src --output-path=blocks/{the_block}/build it outputs this – see screenshot.

    Can you help me to figure it out what to setup?

    Thank you!

Viewing 1 replies (of 1 total)

The topic ‘Build a Gutenberg block’ is closed to new replies.