.DS_Store
e2e/reports
e2e/screenshots
+examples/__build__
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta http-equiv="X-UA-Compatible" content="ie=edge" />
+ <title>Vue Router Examples</title>
+ </head>
+ <body>
+ <div id="app">
+ <h1>Vue Router Examples</h1>
+
+ <ul>
+ <li v-for="example in examples">
+ <a :href="example">/{{ example }}</a>
+ </li>
+ </ul>
+ </div>
+
+ <script src="index.ts"></script>
+ </body>
+</html>
--- /dev/null
+import Vue from 'vue'
+
+const context = require.context('.', true, /^.{2,}\/index\.ts$/)
+const DIR_RE = /^\.\/([^/]+)\//
+
+const examples: string[] = []
+context.keys().forEach(path => {
+ const match = DIR_RE.exec(path)
+ if (match) examples.push(match[1])
+ return name
+})
+examples.sort()
+
+new Vue({
+ el: '#app',
+ data: { examples },
+})
{
- "include": ["*/*ts"],
+ "include": ["index.ts", "*/*ts"],
"compilerOptions": {
"target": "es5",
"module": "commonjs",
mode: process.env.NODE_ENV || 'development',
- // devtool: 'inline-source-map',
+ devtool: 'inline-source-map',
devServer: {
- // contentBase: outputPath,
historyApiFallback: {
rewrites: examples.map(name => ({
from: new RegExp(`^/${name}(?:\\/?|/.*)$`),
to: `/${name}.html`,
})),
- // rewrites: [
- // { from: /^\/encoding(?:\/?|\/.*)$/, to: '/encoding.html' },
- // { from: /^\/hash(?:\/?|\/.*)$/, to: '/hash.html' },
- // ],
},
- // hot: true,
+ hot: true,
},
- entry: examples.reduce((entries, name) => {
- entries[name] = resolve(__dirname, name, 'index.ts')
- return entries
- }, {}),
- // entry: {
- // encoding: resolve(__dirname, 'encoding/index.ts'),
- // hash: resolve(__dirname, 'hash/index.ts'),
- // },
- // entry: fs.readdirSync(__dirname).reduce((entries, dir) => {
- // const fullDir = path.join(__dirname, dir)
- // const entry = path.join(fullDir, 'index.ts')
- // if (fs.statSync(fullDir).isDirectory() && fs.existsSync(entry)) {
- // entries[dir] = ['es6-promise/auto', entry]
- // }
-
- // return entries
- // }, {}),
+ entry: examples.reduce(
+ (entries, name) => {
+ entries[name] = resolve(__dirname, name, 'index.ts')
+ return entries
+ },
+ { index: resolve(__dirname, 'index.ts') }
+ ),
output: {
path: join(__dirname, '__build__'),
template: resolve(__dirname, name, 'index.html'),
})
),
+ new HtmlWebpackPlugin({
+ filename: 'index.html',
+ chunks: ['index'],
+ template: resolve(__dirname, 'index.html'),
+ }),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
"devDependencies": {
"@types/jest": "^24.0.18",
"@types/jsdom": "^12.2.4",
+ "@types/webpack": "^4.39.3",
+ "@types/webpack-env": "^1.14.1",
"@vue/test-utils": "^1.0.0-beta.29",
"axios": "^0.19.0",
"browserstack-local": "^1.4.2",
"@types/istanbul-reports" "^1.1.1"
"@types/yargs" "^13.0.0"
+"@types/anymatch@*":
+ version "1.3.1"
+ resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a"
+ integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA==
+
"@types/babel__core@^7.1.0":
version "7.1.3"
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.3.tgz#e441ea7df63cd080dfcd02ab199e6d16a735fc30"
dependencies:
"@types/node" "*"
+"@types/source-list-map@*":
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9"
+ integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==
+
"@types/stack-utils@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==
+"@types/tapable@*":
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.4.tgz#b4ffc7dc97b498c969b360a41eee247f82616370"
+ integrity sha512-78AdXtlhpCHT0K3EytMpn4JNxaf5tbqbLcbIRoQIHzpTIyjpxLQKRoxU55ujBXAtg3Nl2h/XWvfDa9dsMOd0pQ==
+
"@types/tough-cookie@*":
version "2.3.5"
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.5.tgz#9da44ed75571999b65c37b60c9b2b88db54c585d"
integrity sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg==
+"@types/uglify-js@*":
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.4.tgz#96beae23df6f561862a830b4288a49e86baac082"
+ integrity sha512-SudIN9TRJ+v8g5pTG8RRCqfqTMNqgWCKKd3vtynhGzkIIjxaicNAMuY5TRadJ6tzDu3Dotf3ngaMILtmOdmWEQ==
+ dependencies:
+ source-map "^0.6.1"
+
+"@types/webpack-env@^1.14.1":
+ version "1.14.1"
+ resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.14.1.tgz#0d8a53f308f017c53a5ddc3d07f4d6fa76b790d7"
+ integrity sha512-0Ki9jAAhKDSuLDXOIMADg54Hu60SuBTEsWaJGGy5cV+SSUQ63J2a+RrYYGrErzz39fXzTibhKrAQJAb8M7PNcA==
+
+"@types/webpack-sources@*":
+ version "0.1.5"
+ resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-0.1.5.tgz#be47c10f783d3d6efe1471ff7f042611bd464a92"
+ integrity sha512-zfvjpp7jiafSmrzJ2/i3LqOyTYTuJ7u1KOXlKgDlvsj9Rr0x7ZiYu5lZbXwobL7lmsRNtPXlBfmaUD8eU2Hu8w==
+ dependencies:
+ "@types/node" "*"
+ "@types/source-list-map" "*"
+ source-map "^0.6.1"
+
+"@types/webpack@^4.39.3":
+ version "4.39.3"
+ resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.39.3.tgz#1d55f8fce117a325368bf7612950552ee4ed4467"
+ integrity sha512-afGNNuTfKk1YfHrQ+IwF0QhDkSSMIMMt8BRRErTKaGVvWTMABDjT22/4kJ4bRoSzir9LVgxuuceyZ4Z5I82Cyg==
+ dependencies:
+ "@types/anymatch" "*"
+ "@types/node" "*"
+ "@types/tapable" "*"
+ "@types/uglify-js" "*"
+ "@types/webpack-sources" "*"
+ source-map "^0.6.0"
+
"@types/yargs-parser@*":
version "13.1.0"
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228"