学习前端这门手艺,栈底到栈顶依次是:浏览器架构、Web 网络、事件循环机制、JavaScript 核心、V8 的内存管理、浏览器的渲染流程、Web 安全、CSS、React、Vue、Node、构建工具链等
09-03
测试组件时,需要遍历一下本地图片。发现直接给img绑定src属性为图片的
url
,图片无法显示。
<template>
<div v-for="item,index in pics" :key="index">
<img :src="item.img" alt="">
</template>
<script>
export default {
name: 'test',
data() {
npm
install uglifyjs-
webpack
-plugin -D
const UglifyJsPlugin = require('uglifyjs-
webpack
-plugin')
configure
Webpack
: config => {
if (isProduction) {
config.plugins = config.plugins.concat(
new Ugl
vue init
webpack
my-project
C:\Users\computer\AppData\Roaming\
npm
\node_modules\vue-cli\bin\vue-init:60
let template = program.args[0]
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThis
原因是iview
中
使用了es6语法,然而uglifyJs是不支持的,打开我们的build/
webpack
.prod.conf.js文件,可以看到
// UglifyJs do not support ES6+, you can also use babel-minify for better treeshaking: https://github.com/babel/minify
new
webpack
.optimize.UglifyJsPlugin({
compress: {