Skip to content

Commit

Permalink
chore: add ORSKEY to webpack en variables
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Oct 14, 2021
1 parent a0c3bd5 commit 76bc94a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
// const { VuetifyLoaderPlugin } = require('vuetify-loader')

const env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: require('../config/prod.env')

console.log(env)

const webpackConfig = merge(baseWebpackConfig, {
mode: 'production',
module: {
Expand Down
13 changes: 10 additions & 3 deletions config/prod.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

const packageJson = require('../package.json')

module.exports = {
let ORSKEY = process.env.ORSKEY

let env = {
NODE_ENV: '"production"',
PACKAGE_JSON: JSON.stringify(packageJson),
ORSKEY: process.env.ORSKEY
PACKAGE_JSON: JSON.stringify(packageJson)
}

if (ORSKEY) {
env.ORSKEY = `"${ORSKEY}"`
}

module.exports = env

0 comments on commit 76bc94a

Please sign in to comment.