Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:8.4
- image: circleci/node:12.16.1

steps:
- checkout
Expand All @@ -20,15 +20,15 @@ jobs:
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: yarn install
- run: npm install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# run tests!
- run: yarn test
- run: npm run test

- store_artifacts:
path: ./coverage
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const transform = keys => keys.map(key => typeof key === 'string'
)

module.exports = function NuxtEnv ({ keys }) {
const transformedKeys = transform(keys)
const { nuxtEnv: topLevelConf = { keys: [] } } = this.options
const keysToTransform = [...keys, ...topLevelConf.keys]

const transformedKeys = transform(keysToTransform)
this.addServerMiddleware(middleware(transformedKeys))

const src = path.resolve(__dirname, 'lib/plugin.js')
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const strategies = {
},

client (ctx, inject) {
const env = ctx.nuxtState !== undefined ? ctx.nuxtState.env : ctx.env
const env = ctx.nuxtState ? ctx.nuxtState.env : ctx.env
inject('env', env)
}
}
Expand Down
Loading