Skip to content

Usage in Angular-Cli fails with CommonJS Error #102

Open
@flamusdiu

Description

@flamusdiu

I have following function:

createToc(doc) {
  const options = {}
   const toc = require('markdown-toc');     
        return Promise.resolve().then(() => {
            return new Remarkable()
                .use(toc.plugin(options))
                .render(doc);
        });
}

When building the application, I get the following message:

WARNING in ./node_modules/markdown-toc/lib/utils.js
8:34-41 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

From webpack/webpack#2675, I guess the issue might be here: utils.js#L26

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions