What this will cover
- Host a static website at S3
- Redirect
www.website.com
towebsite.com
- Website can be an SPA (requiring all requests to return
index.html
) - Free AWS SSL certs
- Deployment with CDN invalidation
<template> | |
name: <input type="text" v-model="nameSync"> | |
year: <input type="number" v-model="yearSync"> | |
</template> | |
<script> | |
export default { | |
//... | |
props: { | |
name: { |
<template> | |
<div v-for="(item, index) in valueSync" :key="item.id"> | |
name: <input type="text" v-model="item.name" @input="syncPropValue"> <!-- add event --> | |
years: <input type="number" v-model="item.years" @input="syncPropValue"> <!-- add event --> | |
<button @click="removePepole(index)">remove</button> | |
</div> | |
</template> | |
<script> | |
export default { |
<template> | |
<div v-for="(item, index) in valueSync" :key="item.id"> | |
name: <input type="text" v-model="item.name"> | |
years: <input type="number" v-model="item.years"> | |
<button @click="removePepole(index)">remove</button> | |
</div> | |
</template> | |
<script> | |
export default { |
<script> | |
export default { | |
//... | |
watch: { | |
value: { | |
handler(value, oldValue) { | |
// 同步 value 與 valueSync | |
if (value !== this.valueSync) { | |
this.valueSync = value | |
} |
<template> | |
<div v-for="(item, index) in valueSync" :key="item.id"> | |
name: <input type="text" v-model="item.name" @input="syncPropValue"> | |
years: <input type="number" v-model="item.year" @input="syncPropValue"> | |
<button @click="removePepole(index)">remove</button> | |
</div> | |
</template> | |
<script> | |
export default { |
[ | |
{ | |
"districts":[ | |
{ | |
"zip":"100", | |
"name":"中正區" | |
}, | |
{ | |
"zip":"103", | |
"name":"大同區" |
const path = require('path'); | |
const webpack = require('webpack'); | |
const chokidar = require('chokidar'); // hot reload for html, webpack-dev-server has include this plugin. | |
const htmlWebpackPlugin = require('html-webpack-plugin'); | |
const miniCssExtractPlugin = require("mini-css-extract-plugin"); | |
const terserPlugin = require("terser-webpack-plugin"); // minify js | |
const optimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); | |
const cleanWebpackPlugin = require('clean-webpack-plugin'); | |
const devMode = process.env.NODE_ENV !== 'production'; |