breaking: reduce nodebb.min.js size by around 800kb

const zxcvbn = require('zxcvbn');
bundles a huge amount of code, now it won't be in nodebb.min.js
This commit is contained in:
Barış Soner Uşaklı
2022-08-28 17:45:56 -04:00
parent e20433ecfc
commit b7addffc9e
4 changed files with 7 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
'use strict';
define('forum/reset_code', ['alerts'], function (alerts) {
define('forum/reset_code', ['alerts', 'zxcvbn'], function (alerts, zxcvbn) {
const ResetCode = {};
ResetCode.init = function () {
@@ -13,7 +13,7 @@ define('forum/reset_code', ['alerts'], function (alerts) {
resetEl.on('click', function () {
try {
utils.assertPasswordValidity(password.val());
utils.assertPasswordValidity(password.val(), zxcvbn);
if (password.val() !== repeat.val()) {
throw new Error('[[reset_password:passwords_do_not_match]]');