前端面试题汇总(不断更新中)

html篇

https://blog.csdn.net/kikikiuu/article/details/110010134

CSS篇

https://blog.csdn.net/kikikiuu/article/details/110010100

JS篇

https://blog.csdn.net/kikikiuu/article/details/110009458

浏览器篇

https://blog.csdn.net/kikikiuu/article/details/110010152

Vue篇

https://blog.csdn.net/kikikiuu/article/details/105102202

小程序篇

https://blog.csdn.net/kikikiuu/article/details/110065075

开发及性能篇

https://blog.csdn.net/kikikiuu/article/details/110010173

webpack篇

webpack常用插件汇总

clean-webpack-plugin 打包前清除已存在的dist目录
html-webpakc-plugin用于生成html的插件
externals 告诉weboack在构建代码中 有哪些是不用被打包的模块
extract-text-webpack-plugin 将css生成文件,而不是内联

如何减少webpack的打包体积

1、去除不必要的插件 刚开始用 webpack 的时候,开发环境和生产环境用的是同一个 webpack 配置文件,导致生产环境打包的
JS 文件包含了一大堆没必要的插件,比如 HotModuleReplacementPlugin, NoErrorsPlugin…
这时候不管用什么优化方式,都没多大效果。所以,如果你打包后的文件非常大的话,先检查下是不是包含了这些插件。
2、去除devtool选项
很多教程都会教你在webpack.config.js中设置devtool选项,比如devtool: ‘eval-source-map’。但是这只适用于开发环境,这会造成打包的文件往往有几M,所以在生产环境必须去除此配置
3.按需打包
使用Lodash时,往往只需要使用其中部分功能,但整个文件引入是不合理的,我们需要通过插件让Webpack按需引入模块。
配置webpack.config.js

var LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
var webpack = require('webpack');
 
module.exports = {
    module: {
        loaders: [{
        loader: 'babel',
        test: /\.js$/,
        exclude: /node_modules/
     }]
 },
 babel: {
    presets: ['es2015'],
    plugins: ['transform-runtime', 'lodash']
 },
 plugins: [
    new LodashModuleReplacementPlugin,
    new webpack.optimize.OccurrenceOrderPlugin,
    new webpack.optimize.UglifyJsPlugin
 ]
}

https://blog.csdn.net/js_admin/article/details/76824004

typescript篇

1.关于typescript的理解与使用

eslint篇

1.关于eslint的理解与使用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值