问题

VUE引用一个新的依赖后,编译打包时出现如下警告:

 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

关键依赖:require函数的使用方式无法静态提取依赖项。

原因

webpack 在使用变量作为require路径时,打包出现 Critical dependencies 警告

解决

在webpack的module配置中增加如下设置,

unknownContextCritical: false,

Critical dependency: require function dependencies cannot be statically extracted相关推荐

  1. 修复Critical dependency: the request of a dependency is an expression警告

    Critical dependency: the request of a dependency is an expression 关键依赖: 依赖关系的请求是一个表达式. 查看 问题代码: let ...

  2. Critical dependency: the request of a dependency is an expression

    vue2项目 当你百分百确认你的代码没有任何问题时,但是powershell还是报了错误[Critical dependency: the request of a dependency is an ...

  3. OC和swift混合工程更新库时报:target has transitive dependencies that include statically linked binaries

    OC和swift混合工程更新库时报:target has transitive dependencies that include statically linked binaries.有时间报的错误 ...

  4. 如何解决 Critical dependency: the request of a dependency is an expression ?

    在使用若依后台时,在部分情况下会出现以下错误: 根据提示我们可以找到主要造成这个问题的代码是以下这段: export const loadView = (view) => { // 路由懒加载r ...

  5. Vue Cli webpack打包出现Waring :Critical dependency: the request of a dependency is an expression

    错误信息: Waring 写法: let name = require(url); 如下写法,错误消失: let name = require(`${url}`);

  6. php 5.3 require,PHP5.3提示PHP Wrequire(./xx.php)arning: [function.require]: failed to open stream

    由于我们一对一主机系统之前设置了严格的目录权限导致很多在PHP5.2下运行的程序转化到PHP5.3环境下会出现以下错误: PHP Warning:  require(./forum.php) [fun ...

  7. Common Lisp 函数 require 和 provide 源代码分析

    2019独角兽企业重金招聘Python工程师标准>>> Common Lisp 函数 require 和 provide 源代码分析 === 涉及文件: l1-files.lisp ...

  8. vue require css html,requirejs vue vue.router简单框架

    index.html 入口页面html> vue `menu`.`name` base.js requirejs 配置文件(function(){    requirejs.config({   ...

  9. require.ensure与require AMD的区别

    转载自  webpack: require.ensure与require AMD的区别 webpack: require.ensure与require AMD的区别 简介 require-ensure ...

  10. ensure函数_webpack的require.ensure()

    注意:在webpack 2里面应该是不建议使用require.ensure()这个方法的.但是目前该方法仍然有效 webpack 在编译时,会静态地解析代码中的 require.ensure(),同时 ...

最新文章

  1. YOLO-v4目标检测实时手机端实现
  2. 【设计模式】软件设计七大原则 ( 依赖倒置原则 | 代码示例 )
  3. BOM字符(#8203;)转textNode对象
  4. 四渎《构建之法》——计划估计、敏捷流程、项目经理和用户场景
  5. python画平面直角坐标系_Python之OpenGL笔记(20):画平面直角坐标系
  6. [转]Terraform 使用 - 从最简单例子开始
  7. 看看虚函数表是什么样的
  8. HackerOne 平台诞生首个收入超200万美元的赏金猎人
  9. js弹出框、对话框、提示框、弹窗总结
  10. h5商城模板_“公众号+小程序”才是做微信商城的正确方式
  11. FPGA实现伪彩色图像
  12. 502——错误的网关
  13. HCIA~以太网链路聚合与交换机堆叠、集群
  14. 嵌入式准备 -- git、VSvode
  15. Arduino (一)——面包板与固定导线长度
  16. 业务流程图绘制方法经验谈(下篇)
  17. 【微服务】165:导入数据到索引库
  18. 安卓 每日一题 2020年5-6月问题及答案
  19. 三、SALV 添加自定义的状态栏
  20. jira中新增模块详解

热门文章

  1. zencart 1.5.1 英文原版 安装前和安装后目录文件的变换
  2. 分享CodeIgniter上传图片成功的全过程
  3. IOS 使用webview 显示 doc/docx/xls/pdf等
  4. BUG报告:habahaba风格,图片显示有问题
  5. linux 学习6 软件包管理 资料链接
  6. 在doPost,service等方法里配置字符编码过滤器,防止出现中文乱码
  7. 12.性能之巅 洞悉系统、企业与云计算 --- 基准测试
  8. 16.看板方法---三类改进机会
  9. 13.企业应用架构模式 --- 对象-关系元数据映射模式
  10. 7.Linux 的文件权限和目录配置