'How to spawn a ts file while the webpack will bundle to a file?

I want to create a child-process but webpack will bundle them and the path is not found. Could I just create a child-process using require() such as this:

const child = require('./child')
child.spawn()


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source