随笔分类 -  webpack

摘要:场景 Vue2.6.12 模式:单页面应用(SPA)模式 路由模式:history 模式 【问题一】 刷新页面,出现 Cannot GET / xxx 【解决】 设置 historyApiFallback: true webpack.config.js devServer: { ... histor 阅读全文
posted @ 2020-12-24 22:13 LucasLin 阅读(2072) 评论(0) 推荐(0)
摘要:问题描述: webpack 中,通过使用插件 MiniCSSExtractPlugin ,将生成的 css 文件统一放到 dist/css 目录后,css 文件中 url 路径不正确,导致无法正确加载对应资源(比如:图片)。 相关配置: 使用 报错 解决 阅读全文
posted @ 2020-12-20 23:15 LucasLin 阅读(900) 评论(0) 推荐(0)
摘要:环境: IE 11 vue ^2.6.12 webpack ^5.11.0 webpack-dev-server ^3.11.0 babel ^7.12.10 问题一:开发模式下,chrome 上正常,IE11 上白屏并有报错信息 SCRIPT1002: 语法错误 #####【解决】 问题二:Inv 阅读全文
posted @ 2020-12-20 00:40 LucasLin 阅读(852) 评论(0) 推荐(0)
摘要:问题描述: .vue 文件中的样式不起作用(或没被插入到 style 标签中) 环境: vue:2.6.12 css-loader:4.3.0 vue-loader-style:4.1.0 webpack 配置 { test: /\.scss$/, use: ['vue-style-loader', 阅读全文
posted @ 2020-12-13 20:21 LucasLin 阅读(546) 评论(0) 推荐(0)
摘要:使用 html-webpack-plugin 插件 1. 安装 html-webpack-plugin npm install --save-dev html-webpack-plugin 2. 配置 html-webpack-plugin ... const HtmlWebpackPlugin = 阅读全文
posted @ 2020-12-13 17:58 LucasLin 阅读(289) 评论(0) 推荐(0)
摘要:———————————————————————————————————————————— 1.Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin' 【报错场景】:使用插件html-webpack-plugin后,执行npm r 阅读全文
posted @ 2020-03-16 21:20 LucasLin 阅读(391) 评论(0) 推荐(0)