mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-23 05:35:07 +02:00
🔧 Vue build uses Env vars when specified
This commit is contained in:
parent
59f5decdec
commit
9d7b0d5bc5
5
.env
5
.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
|
@ -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 ProgressBarPlugin = require('progress-bar-webpack-plugin');
|
||||||
const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
|
|
||||||
|
|
||||||
// Get current version
|
// 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 = {
|
module.exports = {
|
||||||
publicPath: process.env.BASE_URL, // || './',
|
publicPath: process.env.BASE_URL,
|
||||||
|
integrity: true,
|
||||||
chainWebpack: config => {
|
chainWebpack: config => {
|
||||||
config.module.rules.delete('svg');
|
config.module.rules.delete('svg');
|
||||||
},
|
},
|
||||||
@ -17,15 +35,13 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
// Display progress bar while building
|
||||||
new ProgressBarPlugin(),
|
new ProgressBarPlugin(),
|
||||||
new WebpackBuildNotifierPlugin({
|
// Insert banner into output chunks
|
||||||
title: 'Dashy Build Complete',
|
new webpack.BannerPlugin({ banner }),
|
||||||
logo: './public/web-icons/dashy-logo.png',
|
|
||||||
suppressSuccess: true,
|
|
||||||
showDuration: true,
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
// Specify resources for PWA / mobile support
|
||||||
pwa: {
|
pwa: {
|
||||||
name: 'Dashy',
|
name: 'Dashy',
|
||||||
manifestPath: './manifest.json',
|
manifestPath: './manifest.json',
|
||||||
@ -40,6 +56,7 @@ module.exports = {
|
|||||||
msTileImage: './web-icons/dashy-logo.png',
|
msTileImage: './web-icons/dashy-logo.png',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// Specify page for app entry point
|
||||||
pages: {
|
pages: {
|
||||||
dashy: {
|
dashy: {
|
||||||
entry: 'src/main.js',
|
entry: 'src/main.js',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user