I have a requirement to check if the passwords created by users are not dictionary words.
The code I have works fine on a small set of test words:
class PasswordHelper {
static passwordContainsDictionaryWord(password) {
return this.WORDS.has(password)
}
static WORDS = new Set(["football", "cricket", "basketball"]);
}
export default PasswordHelper;
When I replace my set of test words with a large set of dictionary words (a total of 3M characters), my Vue compiler freezes on the file.
I went away for lunch and the compiler eventually gave up after throwing the following warning:
[BABEL] Note: The code generator has deoptimised the styling of \src\helper\passwordhelper.js as it exceeds the max of 500KB.
Adding the following configuration to my webpack config did not improve the situation:
loaders: [
{ test: /\.js$/, loader: 'babel', query: {compact: false} }
]
Any ideas how I might get around this problem?
EDIT: Questions linked are NOT duplicates. The OPs in the linked questions are simply asking about warnings they are seeing in the logs and have not experienced issues blocking their compiling. Setting Babel to produce compact or non-compact output does NOT effect my problem, it freezes in either case.