![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Vuejs学习笔记
weixin_47241129
这个作者很懒,什么都没留下…
展开
-
打包html的Plugin
在真实发布项目时,需要将index.html文件打包到dist文件夹中,这时可以使用HtmlWebpackPlugin1.安装(要注意版本问题)npm install html-webpack-plugin --save-dev2.作用自动生成—个index.html文件(可以指定模板来生成)将打包的js文件自动通过script标签插入到body中3.使用webpack.config.js中添加const HtmlWebpackPlugin=require('html-webpack-原创 2021-06-15 10:37:07 · 106 阅读 · 0 评论 -
npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! meetwebpack@1.0.0 build: `webpack` npm ERR! Exit
报错提示npm ERR! code ELIFECYCLEnpm ERR! errno 2npm ERR! meetwebpack@1.0.0 build: `webpack`npm ERR! Exit status 2npm 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 · 2599 阅读 · 0 评论 -
解决webpack : 无法加载文件 C:\Users\...,因为在此系统上禁止运行脚本。
在webpack前加npx npx webpack .\src\main.js .\dist\bundle.js原创 2021-06-11 20:43:18 · 393 阅读 · 0 评论 -
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 · 186 阅读 · 0 评论