vue 配置babel
来源:互联网 发布:青海干部网络教育 编辑:程序博客网 时间:2024/06/01 18:21
首先install babel
cnpm install --save-dev babel-loader babel-core babel-preset-env babel-plugin-transform-runtime babel-plugin-istanbul babel-polyfill babel-preset-stage-2 babel-register
webpack module配置
module: { rules: [ { test: /\.vue$/, loader: 'vue-loader', options: { loaders: { scss: 'vue-style-loader!css-loader!sass-loader' // <style lang="scss"> } } }, { test: /\.js$/, exclude: /(node_modules|bower_components)/, loader: 'babel-loader' } ]}
为了兼容ie 入口处加入 babel-polyfil
entry: { app: ['babel-polyfill', './src/main.js']},
然后在根目录新建.babelrc文件 加入配置项
{ "presets": [ ["env", { "modules": false }], "stage-2" ], "plugins": ["transform-runtime"], "comments": false, "env": { "test": { "presets": ["env", "stage-2"], "plugins": [ "istanbul" ] } }}
阅读全文
0 0
- vue 配置babel
- ES6: babel配置与babel-clic安装
- 配置babel文件
- express配置babel
- es6 babel转码器安装配置
- babel到底该如何配置
- babel配置,这个真详细--
- babel
- babel
- babel
- babel
- 搭建vue2.0+vuex+vue-router+babel+webpack环境
- webpack +Reactjs +babel 加载器配置
- Material-UI + React + Babel + Webpack 环境配置
- babel 配置探究及错误解析
- babel-polyfill 配置支持IE版本
- Material-UI + React + Babel + Webpack 环境配置
- [grunt] grunt 配置babel es6转码
- 文章标题
- 快学Scala习题解答—第二章 控制结构和函数
- Minigame Learning for Day 1
- msfencode的基本使用
- Linux 包管理 yum / apt-get / rpm / dpkg / wget
- vue 配置babel
- 树的深度和广度遍历(JavaScript版)
- python爬取网页
- NYOJ 179 LK's problem ......
- R学习笔记(一)数据结构
- VIM命令速查
- 杭电1002(纯C版)
- 欢迎使用CSDN-markdown编辑器
- 福建省队集训游记