![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
webpack
兔子零-A酱
每天努力一点,生活总不会过得太差
展开
-
webpack4
const path = require('path')const HtmlWebPackPlugin = require('html-webpack-plugin') // 导入 在内存中自动生成 index 页面的插件// 创建一个插件的实例对象const htmlPlugin = new HtmlWebPackPlugin({ template: path.join(__dirname, '/src/index.html'), // 源文件 filename: 'index.h原创 2020-05-26 13:40:51 · 117 阅读 · 0 评论 -
webpack
对于入门选手来讲,webpack 配置项很多很重,如何快速配置一个可用于线上环境的 webpack 就是一件值得思考的事情。其实熟悉 webpack 之后会发现很简单,基础的配置可以分为以下几个方面:entry 、 output 、 mode 、 resolve 、 module 、 optimization 、 plugin 、 source map 、 performance 等,本文就来重点...原创 2020-01-09 10:10:54 · 277 阅读 · 0 评论 -
打包时删除控制台输出注释
new webpack.optimize.UglifyJsPlugin({ //删除注释 output:{ comments:false }, //删除console 和 debugger 删除警告 compress:{ warnings:false, drop_debugger:true...原创 2019-05-04 22:35:39 · 1454 阅读 · 0 评论 -
简单的webpack
package.json文件{ "name": "webpack", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "dev": "web...原创 2019-05-04 23:26:24 · 143 阅读 · 0 评论 -
vue.config.js基础模板
module.exports = { baseUrl: process.env.NODE_ENV === 'production' ? '//your_url' : '/', outputDir: 'dist', assetsDir: 'static', filenameHashing: true, // When building in multi-p...原创 2019-05-06 11:01:07 · 1473 阅读 · 0 评论 -
vscode 使用ESLint 自动检查,保存时自动格式化
1:全局安装eslintnpm install -g eslint2: 打开vscode 点击 “文件”-----》“首选项”----》“设置”,在右侧“用户设置/settings.json”里加入一下配置:{ //eslint 代码自动检查相关配置 "eslint.enable": true, "eslint.autoFixOnSave": true, ...原创 2019-05-21 22:04:56 · 15450 阅读 · 0 评论 -
vue-cli3配置favicon.ico
01.首先在index.html文件配置<link rel="icon" href="<%= BASE_URL %>favicon.ico">02.vue.conflg.js文件配置 // 第三方插件配置 pluginOptions: { // ... pwa: { iconPaths: { favicon32: '....原创 2019-05-26 19:17:32 · 10023 阅读 · 2 评论 -
Tip: built files are meant to be served over an HTTP server.
Tip: built files are meant to be served over an HTTP server.Opening index.html over file:// won’t work.npm install -g http-server // 该命令只需执行一次, 安装过之后, 以后就不需要重复安装了.就可以解决这个问题...原创 2019-08-19 21:13:52 · 3672 阅读 · 2 评论 -
webpack配置
webpack.config.js// webpack loader列表// https://doc.webpack-china.org/loaders/less-loader// webpack plugin列表// https://github.com/webpack-contrib/awesome-webpack#webpack-pluginsconst path = requir...原创 2019-08-14 23:34:50 · 154 阅读 · 0 评论