Skip to content

require.context crashes in main.ts #2531

Closed
@sandiprb

Description

@sandiprb

Version

3.0.1

Node and OS info

Node v8.11.3 / Yarn 1.3.2 / Mac OSX

Steps to reproduce

code snippet:

const requireComponents = require.context('./components/common/', false, '/\.vue$/') 

now while doing yarn serve it breaks the build with error

ERROR in src/main.ts
9:34 Property 'context' does not exist on type 'NodeRequire'.

What is expected?

require.context should be allowed in ts definitions for import.

What is actually happening?

context method no available on NodeRequire

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions