vscode中配置webpack

这篇博客介绍了如何在Visual Studio Code(VSCode)中配置Webpack。首先,需要以管理员身份运行VSCode以避免权限问题。接着,通过npm初始化项目并安装Webpack及webpack-cli,既全局安装也作为开发依赖安装。对于Webpack 4.0以上的版本,打包命令发生了变化,不再直接指定输入和输出路径,而是使用'npx webpack'命令,配合选项指定源文件、输出位置及开发模式。
摘要由CSDN通过智能技术生成

1.管理员身份运行vscode,避免无权限执行脚本的冲突问题

2.执行命令

(1)npm init

(2)npm install webpack webpack-cli -g

(3)npm install webpack webpack-cli -D

PS D:\Webpack> cd 01webpack
PS D:\Webpack\01webpack> npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (01webpack) webpack_test
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to D:\Webpack\01webpack\package.json:

{
  "name": "webpack_test",
  "version": "1.0.0",
  "description": "",
  "main": "index.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值