Skip to content

Critical dependency: the request of a dependency is an expression #336

@jaywcjlove

Description

@jaywcjlove
Creating an optimized production build...
Compiled with warnings.

./node_modules/@babel/standalone/babel.js
Critical dependency: the request of a dependency is an expression

./node_modules/@babel/standalone/babel.js
Critical dependency: the request of a dependency is an expression

临时解决方案

$ CI=false npm run doc
module.exports = {
  //...
  module: {
      exprContextCritical: false
  },
};
export default (conf: Configuration, env: 'development' | 'production', options: LoaderConfOptions) => {

  if (env === 'production') {
    /** https://github.com/uiwjs/react-code-preview/issues/94 */
    conf.module!.exprContextCritical = false;
  }

  return conf;
};

Originally posted by @jaywcjlove in #198 (comment)

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