Jump to content

Подключение babel к vuejs и webpack

Recommended Posts

Надо подцепить babel к webpack и vuejs? Сейчас покажу как: 

  1. В файл package.json, в секцию devDependencies добавляем:
    "@babel/core": "^7.11.6",
    "@babel/plugin-transform-runtime": "^7.11.5",
    "@babel/preset-env": "^7.11.5",
    "babel-loader": "^8.1.0",
  2. Создаём файл: .babelrc в корне. В нём прописываем:
      "presets": ["@babel/preset-env"],
      "plugins": [
  3. Переходим в webpack.config.js  и добавляем в раздел module.rules:
        test: /\.js$/,
        use: {
            loader: "babel-loader"



Запускаем. Должно запуститься как надо.


  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...