Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dangerouslySkipConventions #1499

Open
brillout opened this issue Feb 17, 2024 · 0 comments
Open

dangerouslySkipConventions #1499

brillout opened this issue Feb 17, 2024 · 0 comments
Labels
enhancement ✨ New feature or request

Comments

@brillout
Copy link
Member

brillout commented Feb 17, 2024

Description

// vike.config.js

export default {
  dangerouslySkipConventions: {
    // Allow any NODE_ENV value
    nodeEnv: true,
    // Allow any path aliases, e.g. path aliases that cannot be disambiguated from npm package names 
    pathAlias: true
  }
}

This new config turns errors into warnings, unblocking users that cannot respect conventions.

With the upcoming onLog() hook you'll then also be able to suppress the warning.

Vike could accept a value 'suppress-warning' (e.g. dangerouslySkipConventions.nodeEnv === 'suppress-warning') for an easier DX, but we purposely make it tedious to deviate from conventions in order to encourage users to respect them.

Edit: dangerouslySkipConventions.nodeEnv will probably not be needed after #1528 is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant