An experiment project on using testpress and vue-cli together.
vue create testpress
npx create-vuepress-site
npm i -D vuepress-plugin-live acorn-dynamic-import
::: tip acorn-dynamic-import must be installed in order for vuepress-plugin-live to work :::
// docs/.vuepress/config.js
module.exports = {
plugins: [[["live"]]],
};
Register component
// docs/.vuepress/enhanceApp.js
export default ({ Vue }) => {
Vue.component("HelloWorld", HelloWorld);
};
Reference the registered component
```vue live
<button>example</button>
```
npm i -D vuepress-plugin-typescript vuepress-types
// docs/.vuepress/config.js
module.exports = {
plugins: [
[
"vuepress-plugin-typescript",
{
tsLoaderOptions: {
transpileOnly: true,
},
},
],
],
};
npm run doc:build
git checkout gh-pages # git checkout -b gh-pages (first time)
rm docs -r
mv dist docs
git add docs
git commit -m "Rename dist to docs"
git push origin gh-pages