I am trying to integrate TypeScript into Webpack and am looking for some @types types that will help with all the specific Webpack materials.
I used declare function require(string): any;
to use fe .: require('some.scss')
, but was quickly annoyed by adding it directly or over the syntax /// <reference path="...
and hoping there was a better way to do this.
The ideal thing would be just npm i @types/webpack
, but this package only seems to be for the Webpack configuration file, which I think is completely useless ...
to be more specific, I'm trying to get this code to work in TypeScript:
require.ensure([ require('./first') ], function(require) { require('./second') }, 'second');
source share