The 'assure' property does not exist on the type 'NodeRequire'


I'm trying webpack 2 code splitting.

According to this doc:

the following code should include some.css into a new chunk named 'something'

require.ensure([], function(require) {
}, 'something');

but when I run it, I get this error:

ERROR in ./src/index.ts
(4,9): error TS2339: Property 'ensure' does not exist on type 'NodeRequire'.

Any idea about how to fix it? Thanks

I required a javascript document which then did the require. Not exactly the nicest solution, but it did work