Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Externs for node.js core modules; documentation unclear? #33

@benjaminjt

Description

@benjaminjt

It isn't clear how to reference externs.

For example, having trouble with node core modules. Using the gulp plugin to attempt to compile a Node application which includes the following:

const http = require('http');

I get the following errors:

[00:45:29] source/Stats.js:2 (JSC_COMMONJS_MODULE_LOAD_ERROR)
[00:45:29] Failed to load module "http"
[00:45:29] const http = require('http');

Despite including the following flags:

processCommonJsModules: true,
externs: [{ path: './externs/http.js' }],

Where ./externs/http.js is from https://github.com/dcodeIO/node.js-closure-compiler-externs

Surely compiling a node app with core modules is a common use case. Could we include a brief example, or perhaps just an indicator of how to use common externs?

I would offer to contribute, but I really have no idea how to get this working...

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions