vue开发常用插件

dependencies

devDependencies

babel-plugin-import // 会在编译过程中将 import 的写法自动转换为按需引入的方式,注意:配置 babel-plugin-import 插件后将不允许导入所有组件

// .babelrc 中配置
{
  "plugins": [
    ["import", {
      "libraryName": "vant",
      "libraryDirectory": "es",
      "style": true
    }]
  ]
}

stylus stylus-loader // 让vue支持stylus语法

// .vue文件中这样写
<style lang="stylus"></style>

babel-polyfill // 让vue项目兼容IE

// build/webpack.base.conf.js 中配置
require('babel-polyfill') // 加在第一行

module.exports = {
  entry: {
    app: ['babel-polyfill', './src/main.js'] // 入口中加入babel-polyfill
  }
}

猜你喜欢

转载自www.cnblogs.com/shifeng-/p/10001343.html