Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:wrench: Vue build uses Env vars when specified

Alicia Sykes9d7b0d5bc589
diff --git a/.env b/.env
index e69de29b..8894dd20 100644
--- a/.env
+++ b/.env
@@ -0,0 +1,5 @@
+# Store environmental variables here. All variables are optional.
+
+# PORT=4000 # The port to expose the running application on
+# NODE_ENV=production # Can be either development, production or test
+# BASE_URL=/ # The default base path for serving up static assets
\ No newline at end of file
diff --git a/vue.config.js b/vue.config.js
index 95d791e7..6cb054ab 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,11 +1,29 @@
+/**
+ * Global config for the main Vue app. ES7 not supported here.
+ * See docs for all config options: https://cli.vuejs.org/config
+ */
+const webpack = require('webpack');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
-const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
// Get current version
-process.env.VUE_APP_VERSION = require('./package.json').version;
+const { version } = require('./package.json');
+// Set the current version, for use within the app
+process.env.VUE_APP_VERSION = version;
+
+// Make banner text, for output files
+const banner = (() => {
+ const now = new Date();
+ const line1 = `Dashy ${version}. Built at ${now.toLocaleTimeString()} on ${now.toLocaleDateString()}`;
+ const line2 = `Licensed under MIT - (C) Alicia Sykes ${now.getFullYear()}`;
+ const line3 = 'Code + docs: https://github.com/lissy93/dashy';
+ return `${line1}\n${line2}\n${line3}`;
+})();
+
+// Specify and export the main Vue app config
module.exports = {
- publicPath: process.env.BASE_URL, // || './',
+ publicPath: process.env.BASE_URL,
+ integrity: true,
chainWebpack: config => {
config.module.rules.delete('svg');
},
@@ -17,15 +35,13 @@ module.exports = {
],
},
plugins: [
+ // Display progress bar while building
new ProgressBarPlugin(),
- new WebpackBuildNotifierPlugin({
- title: 'Dashy Build Complete',
- logo: './public/web-icons/dashy-logo.png',
- suppressSuccess: true,
- showDuration: true,
- }),
+ // Insert banner into output chunks
+ new webpack.BannerPlugin({ banner }),
],
},
+ // Specify resources for PWA / mobile support
pwa: {
name: 'Dashy',
manifestPath: './manifest.json',
@@ -40,6 +56,7 @@ module.exports = {
msTileImage: './web-icons/dashy-logo.png',
},
},
+ // Specify page for app entry point
pages: {
dashy: {
entry: 'src/main.js',