本文介绍了带有 Vue JS 2.6 和 VueCli 4.0 的 Webpack的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 VueCli 4.0 安装 Webpack.

I'm trying to install Webpack with the VueCli 4.0.

使用旧的 Deprecated Vue Cli 运行命令 vue init webpack my-project 会在一个项目中构建一个 webpack 就绪项目,其中包含 babel、SASS、Linting、Router 和 vuex 的选项.然而,这些软件包看起来很旧,现在已弃用.

With the older Deprecated Vue Cli running the command vue init webpack my-project would scaffold a webpack ready project with the options for babel, SASS, Linting, Router and vuex all in one project. However the packages seem very old and this is now deprecated.

新版vue cli没有webpack.config文件.我想在我的项目中添加一个预渲染,但不知道在哪里添加它.它会进入到 vue.config.js 文件中吗?

The new version of the vue cli does not have the webpack.config file. I want to add a prerender to my project but don't know where to add it. Does it go into the vue.config.js file?

如何使用当前 2.6.11 VueCli 4.0 的最新版本 vuejs 创建和添加插件,例如使用 webpack 和 vue 一起预渲染?

How can I create and add plugins such as a prerender with webpack and vue together using the latest version of vuejs which is currently 2.6.11 the VueCli 4.0?

推荐答案

Vue CLI 进步了很多.现在大部分配置都在幕后完成.如果您需要添加插件或进一步配置,则只需创建 vue.config.js 文件(如果尚未创建).

The Vue CLI has advanced quite alot. With much of the configuration now done behind the scenes. If you need to add plugins or further configuration, you just need to create the vue.config.js file if it has not already been created.

您还可以使用 Vue UI 并搜索插件.如果插件可用,vue 只需运行并安装它需要的东西.很酷.否则只需将它们添加到 vue.config.js 文件中

You can also use the Vue UI and search for plugins. If plugins are available vue just runs and installs what it needs. Pretty cool. Otherwise just add them in the vue.config.js file

这篇关于带有 Vue JS 2.6 和 VueCli 4.0 的 Webpack的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 13:46