experiments

All kinds of coding experiments
Log | Files | Refs | Submodules

commit 98a4381b7234254ec0b0e1e9a11d928d7b3fcde3
parent 6c47a08b39183d35ecc0bfa610bcb8199f767825
Author: Vetle Haflan <vetle@haflan.dev>
Date:   Thu, 17 Sep 2020 19:31:55 +0200

Add alternative Vue boilerplate code approach

Diffstat:
Rvue-app-boilerplate/.gitignore -> vue-template/.gitignore | 0
Avue-template/readme.md | 7+++++++
Avue-template/vue-cli/generate.sh | 5+++++
Avue-template/vue-cli/setup.sh | 21+++++++++++++++++++++
Rvue-app-boilerplate/dockerdev.sh -> vue-template/webpack/dockerdev.sh | 0
Rvue-app-boilerplate/index.html -> vue-template/webpack/index.html | 0
Rvue-app-boilerplate/package.json -> vue-template/webpack/package.json | 0
Rvue-app-boilerplate/src/App.vue -> vue-template/webpack/src/App.vue | 0
Rvue-app-boilerplate/src/app.js -> vue-template/webpack/src/app.js | 0
Rvue-app-boilerplate/webpack.config.js -> vue-template/webpack/webpack.config.js | 0
10 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/vue-app-boilerplate/.gitignore b/vue-template/.gitignore diff --git a/vue-template/readme.md b/vue-template/readme.md @@ -0,0 +1,7 @@ +In this dir: Two versions of Vue boilerplate / setup. +Both run `npm` in a Docker container, to avoid polluting the local file system ;) + +- `vue-cli`: For generating boilerplate for future dev with `vue-cli`. + Simply run `setup.sh` to generate a fresh Vue app . +- `webpack`: Can be used as is, just run dockerdev.sh. Uses `webpack` _instead + of_ `vue-cli` diff --git a/vue-template/vue-cli/generate.sh b/vue-template/vue-cli/generate.sh @@ -0,0 +1,5 @@ +#!/bin/sh +cd /vue +npm install -g @vue/cli || exit 1 +vue create $VUE_APP +chown -R $DOCKER_USER: /vue diff --git a/vue-template/vue-cli/setup.sh b/vue-template/vue-cli/setup.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Set up a Vue application in the current directory + +if [ -z "$1" ]; then + echo "Please give name of application" + exit +fi + + +docker run -it \ + --name vue-$1 \ + --env VUE_APP=$1 \ + --env DOCKER_USER=$UID \ + -v $PWD:/vue node:alpine /bin/sh \ + -C /vue/generate.sh + +docker rm -f vue-$1 + +# Inspired by: +# https://daten-und-bass.io/blog/getting-started-with-vue-cli-on-docker/ diff --git a/vue-app-boilerplate/dockerdev.sh b/vue-template/webpack/dockerdev.sh diff --git a/vue-app-boilerplate/index.html b/vue-template/webpack/index.html diff --git a/vue-app-boilerplate/package.json b/vue-template/webpack/package.json diff --git a/vue-app-boilerplate/src/App.vue b/vue-template/webpack/src/App.vue diff --git a/vue-app-boilerplate/src/app.js b/vue-template/webpack/src/app.js diff --git a/vue-app-boilerplate/webpack.config.js b/vue-template/webpack/webpack.config.js