fix(layout): config first, then js loads