Skip to content

Commit

Permalink
fix(cypress): process.env.ORSKEY variable not resolving
Browse files Browse the repository at this point in the history
in the webpack build using the webpack.cypres.conf.js the secrets were
not yet passed properly.

- adjusted cypress webpack config
- this needs to be reworked in the switch to using environment variables
  • Loading branch information
TheGreatRefrigerator committed Jan 27, 2023
1 parent 224e0a8 commit 49c290d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions build/webpack.cypress.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@ const { resolveRoot, styleLoaders} = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
const webpack = require('webpack')
const packageJson = require("../package.json")

let ORSKEY = process.env.ORSKEY
let BITLYLOGIN = process.env.BITLYLOGIN
let BITLYAPIKEY = process.env.BITLYAPIKEY

let env = {
PACKAGE_JSON: JSON.stringify(packageJson)
}
if (ORSKEY) {
env.ORSKEY = `"${ORSKEY}"`
}
if (BITLYLOGIN) {
env.BITLYLOGIN = `"${BITLYLOGIN}"`
}
if (BITLYAPIKEY) {
env.BITLYAPIKEY = `"${BITLYAPIKEY}"`
}

const createLintingRule = () => ({
test: /\.(js|vue)$/,
Expand All @@ -22,6 +39,9 @@ module.exports = {
// fix "process is not defined" error:
new webpack.ProvidePlugin({
process: 'process/browser',
}),
new webpack.DefinePlugin({
'process.env': env
})
],
context: resolveRoot(),
Expand Down

0 comments on commit 49c290d

Please sign in to comment.