- 博客(4)
- 收藏
- 关注
原创 打包html的Plugin
在真实发布项目时,需要将index.html文件打包到dist文件夹中,这时可以使用HtmlWebpackPlugin 1.安装(要注意版本问题) npm install html-webpack-plugin --save-dev 2.作用 自动生成—个index.html文件(可以指定模板来生成)将打包的js文件 自动通过script标签插入到body中 3.使用 webpack.config.js中添加 const HtmlWebpackPlugin=require('html-webpack-
2021-06-15 10:37:07
180
原创 npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! meetwebpack@1.0.0 build: `webpack` npm ERR! Exit
报错提示 npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! meetwebpack@1.0.0 build: `webpack` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the meetwebpack@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional l
2021-06-15 09:40:44
2840
原创 webpack.config.js配置和package.json配置
一、入口和出口 将入口参数和出口参数写到配置文件里,运行时直接读取 创建一个webpack.config.js文件 const path =require('path') module.exports = { //入口:可以是字符串/数组/对象 entry: './src/main.js', //出口:通常是对象,里面至少包含两个重要属性path和filename output: { path:path.resolve(__dirname,'dist'),//
2021-06-11 22:40:37
255
原创 解决webpack : 无法加载文件 C:\Users\...,因为在此系统上禁止运行脚本。
在webpack前加npx npx webpack .\src\main.js .\dist\bundle.js
2021-06-11 20:43:18
493
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅