Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 4, 2023. It is now read-only.

fix bugs:#727

Open
snovey wants to merge2 commits intoSimulatedGREG:master
base:master
Choose a base branch
Loading
fromsnovey:master
Open

fix bugs:#727

snovey wants to merge2 commits intoSimulatedGREG:masterfromsnovey:master

Conversation

snovey
Copy link
Contributor

@snoveysnovey commentedOct 23, 2018
edited
Loading

The value ofprocess.env.NODE_ENV is never set todevelopment in the project.

Only runnpm run build will get correct value ofprocess.env.NODE_ENV, other command will getundefined.

I want to lintno-debugger when runnpm run lint ornpm run build but not lintno-debugger when runnpm run dev.(EsLint is going to read the.eslintrc.js file very early on, so to set the value ofprocess.env.NODE_ENV before that, set the value indev-runner file).

Sorry for my poor English...

1. `process.env.NODE_ENV` get undefined when `npm run lint`2. won't lint `no-debugger` when `npm run lint`
@@ -1,5 +1,7 @@
'use strict'

process.env.NODE_ENV='production'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think it's right way to fix this bug.

snovey reacted with thumbs up emoji
Copy link
ContributorAuthor

@snoveysnoveyNov 2, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

So stupid mistake!
Thank you for reminding me. I have fixed it. Is this the desired result now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

  1. process.env.NODE_ENV is undefined in.eslintrc.js in development mode, because we are not passing string while linter runs, but for production it readsproduction as string, it works how it should and.eslintrc.js doesn't need changes.
  2. Highlighted third line in your code, I think is wrong way to pass data for NODE_ENV, you can do it same way as we did for production:
    "pack:renderer":"cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",

    right example:
    cross-env NODE_ENV=development webpack --progress --colors --config .electron-vue/webpack.renderer.config.js

Conclusion:
debugger for development environment already works fine and currently we have only two mode for NODE_ENV:development &production, in most casesNODE_ENV isundefined because we start coding from development and then we separate environment for production.
I hope you understand idea

sorry for my careless
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers
1 more reviewer

@shavidzetshavidzetshavidzet requested changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@snovey@shavidzet

[8]ページ先頭

©2009-2025 Movatter.jp