Comments (2)
问题
怎么配置 Git hook--CLI服务
https://cli.vuejs.org/zh/guide/cli-service.html#git-hook
依赖需要 polyfill 时怎么处理--浏览器兼容性
https://cli.vuejs.org/zh/guide/browser-compatibility.html#polyfill
怎么构建一个多页应用
// vue.config.js
module.exports = {
pages: {
index: {
// page 的入口
entry: 'src/index/main.js',
// 模板来源
template: 'public/index.html',
// 在 dist/index.html 的输出
filename: 'index.html',
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title: 'Index Page',
// 在这个页面中包含的块,默认情况下会包含
// 提取出来的通用 chunk 和 vendor chunk。
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
// 当使用只有入口的字符串格式时,
// 模板会被推导为 `public/subpage.html`
// 并且如果找不到的话,就回退到 `public/index.html`。
// 输出文件名会被推导为 `subpage.html`。
subpage: 'src/subpage/main.js'
}
}
webpack-chain
from blog.
配置开发环境的请求代理:devServer
该配置只在开发环境有效,具有类似Nginx的反向代理的功能,并提供以下功能:
- 提供一个开发服务器,可以访问项目,并支持热模块替换
配置代理
当你的前端应用和后端 API 服务器没有运行在同一个主机上,你需要在开发环境下将 API 请求代理到 API 服务器(为了避免浏览器的同源策略问题)
module.exports = {
devServer: {
proxy: {
'/api': {
target: '<url>',
ws: true,
changeOrigin: true
},
'/foo': {
target: '<other_url>'
}
}
}
}
详细配置看文档
参考
https://github.com/chimurai/http-proxy-middleware#proxycontext-config
https://webpack.js.org/configuration/dev-server/
https://cli.vuejs.org/zh/config/#devserver-proxy
from blog.
Related Issues (20)
- DOMContentLoaded 与 load、defer 与 async
- webpack相关
- Node相关
- Vue styleguidist相关
- standard-version:版本控制、生成 changelog、打 tag
- element 和 mouseEvent 的位置和尺寸信息相关
- 用class+ts编写vue组件:vue-property-decorator相关
- 尾调用优化:尾递归优化
- 严格模式、替代 eval 的 Function
- TypeScript的模块解析逻辑(类似Node)
- 全屏H5时兼容刘海屏
- css坑!height 使用百分比单位时注意
- in 和 hasOwnProperty
- MutationObserver:监听DOM变化事件(插入、删除、变更等)的观测器
- eject啥意思
- babel插件
- node笔记-全局对象和全局变量
- 动画的12项基本法则
- Git-flow
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.