1、基本配置 webpack.common.js const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') const { srcPath, distPath } = require(' ...
分类:
Web程序 时间:
2020-07-10 11:36:07
阅读次数:
104
1 创建webpack.config.js文件 const path = require('path') module.exports = { entry: './src/main.js', output: { path: path.resolve(__dirname, 'dist'), filen ...
分类:
Web程序 时间:
2020-07-10 00:32:47
阅读次数:
84
1、在index.html中引入百度秘钥 <script src="http://api.map.baidu.com/api?v=3.0&ak=申请的key"></script> 2、在webpack的配置文件中设置外部扩展: 如果是Vue-cli2,在build/webpack.base.conf ...
分类:
其他好文 时间:
2020-07-09 19:44:38
阅读次数:
151
在模块化编程中,开发者将程序分解成离散功能块(discrete chunks of functionality),并称之为模块。 每个模块具有比完整程序更小的接触面,使得校验、调试、测试轻而易举。 精心编写的模块提供了可靠的抽象和封装界限,使得应用程序中每个模块都具有条理清楚的设计和明确的目的。 N ...
分类:
Web程序 时间:
2020-07-09 12:39:02
阅读次数:
80
1、Sass -- vue解决sass-loader的版本过高导致的编译错误 Module build failed: TypeError: this.getResolve is not a function at Object.loader (C:\Users\Baicells\Desktop\h ...
分类:
Web程序 时间:
2020-07-08 13:11:47
阅读次数:
84
代码里如果用到const 关键字,编译报这种错误 解决方法: npm install terser-webpack-plugin --save然后,webpack配置: const TerserPlugin = require('terser-webpack-plugin'); module.exp ...
分类:
Web程序 时间:
2020-07-08 11:45:45
阅读次数:
310
webpack4 面试题 随着现代前端开发的复杂度和规模越来越庞大,已经不能抛开工程化来独立开发了,如react的jsx代码必须编译后才能在浏览器中使用;又如sass和less的代码浏览器也是不支持的。 而如果摒弃了这些开发框架,那么开发的效率将大幅下降。在众多前端工程化工具中,webpack脱颖而 ...
分类:
Web程序 时间:
2020-07-08 01:08:31
阅读次数:
122
webpack学习记录 开发模式 development const { resolve } = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); // html打包 const MiniCssExt ...
分类:
Web程序 时间:
2020-07-08 01:07:04
阅读次数:
88
webpack npm run dev 不能通过ip访问只能通过localhost访问解决方法如下:修改vue-cli: config/index.js 文件把文件中 host 的值,改成 ip 即可 ...
分类:
其他好文 时间:
2020-07-07 23:38:41
阅读次数:
166
webpack npm run dev 不能通过ip访问只能通过localhost访问解决方法如下:修改vue-cli: config/index.js 文件把文件中 host 的值,改成 ip 即可 ...
分类:
其他好文 时间:
2020-07-07 23:24:40
阅读次数:
68