Include node module in static js

Installed a node package via npm i resize-start-end -S'.

This is the instruction provided by the package:

    // ESM
    import resizeStartEnd from 'resize-start-end';
    // or CommonJS
    const resizeStartEnd = require('resize-start-end');

I’m trying to include the package in a JS file in my hugo static directory. None of the above works (can’t be found).

My js is located in static/src/js and gulp will concat it into static/js.

Advice appreciated.

1 Like

You need to ask JavaScript related questions in a JavaScript forum.