Skip to content

Commit

Permalink
environment added
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejsharapov committed Sep 15, 2022
1 parent cffbdf7 commit 21ce42a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NODE_ENV=development
VUE_APP_TITLE="v-b-s dev"
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_ENV=production
7 changes: 2 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Vue Box-shadows</title>
<title><%= VUE_APP_TITLE %> · <%= VUE_APP_VERSION %></title>
</head>
<body>
<div id="app">
Collection of CSS box-shadows for every taste contains more than 100
simple, beautiful and airy shadows.
</div>
<div id="app"><%= VUE_APP_DESCRIPTION %></div>
</body>
</html>
24 changes: 24 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { defineConfig } = require("@vue/cli-service");
const path = require("path");

process.env.VUE_APP_VERSION = require("./package.json").version;
process.env.VUE_APP_DESCRIPTION = require("./package.json").description;

module.exports = defineConfig({
lintOnSave: true,
devServer: {
port: 8080,
},
chainWebpack: (config) => {
config.resolve.alias.set("@", path.resolve(__dirname, "src/"));
if (process.env.NODE_ENV == "production") {
VUE_APP_TITLE = require("./package.json").name;
// } else {
}
},
outputDir: path.resolve(
__dirname,
process.env.NODE_ENV === "production" ? "dist/" : "/"
),
productionSourceMap: false,
});

0 comments on commit 21ce42a

Please sign in to comment.