获得徽章 0
- vim /etc/profile
vim ~/.bash_profile
export path=$path:/home/download:/usr/local/
source /etc/profile
source ~/.bash_profile展开评论点赞 - 节前公司换了新MAC笔记本,安装brew的时候卡死了。用了这个办法很棒
/usr/bin/ruby -e "$(curl -fsSLcdn.jsdelivr.net)"
cd "$(brew --repo)/Library/Taps/"
mkdir homebrew && cd homebrew
git clone git://mirrors.ustc.edu.cn/homebrew-core.git
cd "$(brew --repo)/Library/Taps/"
cd homebrew
git clonemirrors.ustc.edu.cn
展开赞过评论1 - docker run --name my_nginx -d -p 80:80 -v /kevingithub/dockerconf/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /kevingithub/dockerconf/nginx/log:/var/log/nginx -v /kevingithub/dockerconf/nginx/html:/usr/share/nginx/html nginx展开评论点赞
- Prettier Exception
js // prettier-ignore
jsx {/* prettier-ignore */}
html <!-- prettier-ignore -->
css /* prettier-ignore */
markdown <!-- prettier-ignore -->展开评论点赞 - splitChunks
chunks:
all: 不管文件是动态还是非动态载入,统一将文件分离。当页面首次载入会引入所有的包
async: 将异步加载的文件分离,首次一般不引入,到需要异步引入的组件才会引入。
initial:将异步和非异步的文件分离,如果一个文件被异步引入也被非异步引入,那它会被打包两次(注意和all区别),用于分离页面首次需要加载的包。展开评论点赞 - 环境变量配置一般都在.bash_profile文件中,重启需要手动加载。在.zshrc配置文件中调用.bash_profile文件,可实现自动重启自动调用。如:source /Users/mymac/.bash_profile评论点赞
- HtmlWebpackPlugin
这个plugin曝光率很高,他主要有两个作用:
1.为html文件中引入的外部资源如script、link动态添加每次compile后的hash,防止引用缓存的外部文件问题
2.可以生成创建html入口文件,比如单页面可以生成一个html文件入口,配置N个html-webpack-plugin可以生成N个页面入口展开等人赞过评论5