Gutenberg Block Development: Trying to add custom js script to npm start command by modifying webpack.config

Thank you all for your help! I was on it since days!

I found my problem:

https://webpack.js.org/concepts/entry-points/ helped me to find the solution

Apparently path.resolve( process.cwd(), 'src', 'slider.js' ) was not working:
replacing by simple string path fixed the problem:

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

module.exports = {
    ...defaultConfig,
    entry: {
        ...defaultConfig.entry,
        slider: './src/slider.js',
    },
};