美文网首页
Vue 兼容ie 使用transpileDependencies

Vue 兼容ie 使用transpileDependencies

作者: littlesunn | 来源:发表于2021-01-05 18:05 被阅读0次

node_modules里的依赖默认是不会编译的,会导致es6语法在ie中的语法报错,所以需要在vue.config.js中使用transpileDependencies属性配置node_modules中指定哪些文件夹或文件需要编译.

    transpileDependencies: [
        /[/\\]node_modules[/\\](.+?)?element-ui(.*)[/\\]src/,
        /[/\\]node_modules[/\\](.+?)?element-ui(.*)[/\\]package/,
        /[/\\]node_modules[/\\](.+?)?f-render(.*)/,
        /[/\\]node_modules[/\\](.+?)?quill-image-drop-module(.*)/,
        /[/\\]node_modules[/\\](.+?)?vue-ele-form(.*)/,
        /[/\\]node_modules[/\\](.+?)?vue-ele-form-bmap(.*)/,
        /[/\\]node_modules[/\\](.+?)?vue-baidu-map(.*)/,
        /[/\\]node_modules[/\\](.+?)?vue-ele-upload-image(.*)/,
    ],

我这里提供参考;


image.png

他接受字符串或者正则,网上很多人直接写文件夹名称无效;比如 ['element-ui']
那试试使用上面的正则匹配;

相关文章

  • Vue 兼容ie 使用transpileDependencies

    node_modules里不会编译es6导致语法报错,所以需要在vue.config.js中使用transpile...

  • Vue项目兼容IE11

    Vue项目兼容IE11 Vue 不支持 IE8 及以下版本,因为 Vue 使用了 IE8 无法模拟的 ECMASc...

  • Vue 基础

    前言 Vue 的兼容性 Vue 不支持 IE8 及以下版本,因为 Vue 使用了 IE8 无法模拟的 ECMASc...

  • Vue.js ToDoList和MVVM模式

    安装Vue插件 兼容性 Vue不支持IE8 及以下版本,因为 Vue 使用了 IE8 无法模拟的 ECMAScri...

  • 前端主流框架对IE浏览器支持性调查

    Vue Vue官方文档上有这么一句: 兼容性:Vue 不支持 IE8 及以下版本,因为 Vue 使用了 IE8 无...

  • VUE复习笔记1(开始)

    兼容性 Vue 不支持 IE8 及以下版本,因为 Vue 使用了 IE8 无法模拟的 ECMAScript 5 特...

  • 1-Vue基础知识

    兼容性 Vue不支持IE8 及以下版本,因为 Vue 使用了 IE8 无法模拟的 ECMAScript 5 特性。...

  • Vue.js 入门

    1 安装 1.1 兼容性 Vue 不支持 IE8 及以下版本,因为 Vue 使用了 IE8 无法模拟的 ECMA...

  • 1、认识vue

    1.vue兼容性 vue不支持IE8及以下版本,因为vue使用的是IE8无法模拟的ECMAScript 5特性。v...

  • 安装

    兼容性 Vue.js 不支持 IE8 及其以下版本,因为 Vue.js 使用了 IE8 不能模拟的 ECMAScr...

网友评论

      本文标题:Vue 兼容ie 使用transpileDependencies

      本文链接:https://www.haomeiwen.com/subject/hpuwoktx.html