Skip to content

Conversation

@nmilenkovic
Copy link

Fix problem with babel cache problem, ability to switch versions with command line args

"dev": "next",
"build": "next build",
"clean": "rimraf .\\node_modules\\.cache",
"build-dev": "npm run clean && next build --env=development",
Copy link
Contributor

Choose a reason for hiding this comment

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

why not simply

"build-dev": "npm run clean && next build",
"build-prod": "npm run clean && NODE_ENV=production next build"

?

Copy link
Author

Choose a reason for hiding this comment

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

maybe we need to pass additional parameters like instance (we need to pass 2 params)

Copy link
Contributor

Choose a reason for hiding this comment

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

Then can just add another env var.

IMHO that's unrelated to what the example is trying to convey. There's no need for command-line-args to get universal config working.

"react-dom": "^15.4.2"
},
"devDependencies": {
"command-line-args": "^4.0.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't understand why this package was needed

Copy link
Author

Choose a reason for hiding this comment

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

I think that this package makes params from command line easy to collect

@timneutkens
Copy link
Member

@arunoda the babel-loader caching issue here makes me think we should clear node_modules/.cache when there is no BUILD_ID present in .next, so we are 100% sure that no babel-loader cache from development is leaked. What do you think?

@arunoda
Copy link
Contributor

arunoda commented Mar 15, 2017

@timneutkens then in development, it won't get used.
What we should do it detect the changes in .babelrc and try to clean it and start the process again.

In the deployment we could clean it, but I rather let it to be done by the user.

@timneutkens
Copy link
Member

@arunoda yeah lets document the way someone has to clear the cache instead of flushing it ourselves.

@timneutkens
Copy link
Member

Closing this in favor of #1432.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants